Comments (9)
Yeah this is an issue with RequireJS CommonJS form actually, and not really in the scope of SystemJS. RequireJS doesn't even mention it in its docs anywhere!
Is there are reason you don't just use normal CommonJS here?
from systemjs.
Yeah this is an issue with RequireJS CommonJS form actually, and not really in the scope of SystemJS.
Yeah, I see how this could be difficult to parse without bringing in some big dependency.
RequireJS doesn't even mention it in its docs anywhere!
It is a bit difficult to search for, but it does: http://requirejs.org/docs/whyamd.html#sugar
Is there are reason you don't just use normal CommonJS here?
For new modules, not really - and I might as well go full-way into es6 and use the import
syntax. It's that I work on a 5-year old application, and most of its JS code was already converted to AMD recently (it used to be globals everywhere).
In the short term I intend to convert all of them (except some that are in coffeescript) to the ES6 syntax. It's just that being able to maintain the system working eases the transition :)
from systemjs.
Ok it does seem the r.js optimizer deals with this by doing the internal rewriting of the require statement.
How are you minifying in this workflow?
from systemjs.
I just uglify all the files (post-traceur). Since the application is served using spdy, I didn't bother to concatenate them. This way, I skip r.js entirely.
from systemjs.
Are you using jspm here? We can potentially include the default minify config in jspm to leave the require statements in.
from systemjs.
No, I'm not. It seems like a good idea though! Could save its users some searching.
Do you think it's worth it starting a wiki page with these kinds of tips?
from systemjs.
It could well be worth starting a wiki, good suggestion. The more resources for different types of users the better. At the moment the README is very much geared to framework authors to understand as much as possible, but overview guides are definitely needed. I will be writing blog posts soon too.
My main worry with a wiki is I don't currently have enough content to fill one. Very much open to suggestions though.
from systemjs.
Maybe start the wiki by splitting the README?
from systemjs.
I'm going to be difficult and stick with the long single-page README for now. The reason being that I think there is value in having a single resource for all information over many. I know it sounds like a good idea to create a wiki, but it could also be the beginning of fragmenting all the information.
This kind of a tip could potentially be included in an FAQs question, potentially in the README or in a wiki. I'm marking this issue with a new FAQ label, and when there are enough will start something.
Closing for now, and thanks for your feedback.
from systemjs.
Related Issues (20)
- import with npm
- How to register a module by API HOT 3
- systemjs load css suport url(image/test.svg) without quotes in url
- setupProxy.js file not working in single-spa-react
- Apply CSS from nested dependency HOT 2
- worker-load.js conflicts with fetch-load.js and prevents systemjs-babel from working in a web worker
- Updating systemjs from 0.21.5 to latest (6.14.1)
- lastScript detection doesn't seem to be 100% reliable HOT 3
- [NodeJS] Should System.import('my-module') refetch if called twice? HOT 2
- Multiple dependencies bundled in one file (previously "bundles" config option)
- Distribution Files published to npm do not match what is in GitHub for version 16.14.2 (have windows style line breaks)
- Definitelytyped types for system-node.cjs HOT 1
- Top-level await does not wait for its dependencies
- system.min.js doesn't include latest version HOT 1
- Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') HOT 1
- Support fetchPriority with external import maps HOT 1
- Conflicting SystemJS instances — how to resolve? HOT 6
- Content Security Policy `unsafe-eval` and `unsafe-inline` still required? HOT 1
- I need to prevent SystemJS attempting to load dependencies on Shopify site, urls require a version parameter that SystemJS doesn't know HOT 1
- importMap dependencies error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systemjs.