Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: optimizer: mention array form for command line args #369

Open
jrburke opened this issue Jul 10, 2012 · 6 comments
Open

Docs: optimizer: mention array form for command line args #369

jrburke opened this issue Jul 10, 2012 · 6 comments
Labels

Comments

@jrburke
Copy link
Member

jrburke commented Jul 10, 2012

Here:

http://requirejs.org/docs/optimization.html#pitfalls

when showing the command line args, should show one, like include, which is array based, to show how that looks.

@chris-h-sg
Copy link

This would be helpful. I've been looking for it just now but haven't found it anywhere. For the time being, could you perhaps provide an example here?

@jrburke
Copy link
Member Author

jrburke commented Jun 11, 2013

include=one,two is the same as include: ['one', 'two'], so just comma-separated, no spaces.

@chris-h-sg
Copy link

I tried that as stubModules=cs,text but it doesn't seem to be working. I'm getting an error Error: TypeError: Object cs,text has no method 'forEach'. Any idea why that is?

@jrburke
Copy link
Member Author

jrburke commented Jun 14, 2013

@thrar, loader plugins need to be part of the build, so it sounds like the config you are using is trying to remove them. If you are using a paths config to point to 'empty:' for them, instead, use exclude=cs,text with stubModules=cs,text

@chris-h-sg
Copy link

Really? I've been using stubModules=['cs', 'text'] in my config script file and it seems to be working; the resulting minified file is a few kB smaller than otherwise. To me it seems that only the command line invocation doesn't let me use this option.

@jrburke
Copy link
Member Author

jrburke commented Jun 15, 2013

Ah, sorry I misunderstood. The stubModules thing was a bug, tracked here: requirejs/r.js#464 and fixed for 2.1.7. You can try the latest master snapshot to confirm the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants