Frage

I am using requirejs with coffeescript and cs plugin. When I go to production I bundle all using r.js optimizer which uses coffeescript.js to complie my cs files into javascript and put it all in all.js

In runtime, there is no need to the 159K coffeescript files, how can I prevent r.js from pushing it into the bundle and save this huge file space

War es hilfreich?

Lösung

Use StubModules in requirejs configuration:

    stubModules: ['cs','coffee-script']

Andere Tipps

If you're using this plugin it seems this should just work as part of the build process.

If thats not the case, its easy to set up manually:

In your bundle script, run the coffee executable first to build the coffeescript files to js, and then run r.js on those javascript files to optimize them.

Then you can even delete the temp js files if you like and only keep your single bundled files.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top