Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do not copy source file when optimizing using requirejs

Tags:

requirejs

When using require.js (r.js) to optimize js code, all js source code are copied to destination directory(dir property).

Is there a way (some configuration) to prevent requirejs to copy source files?

like image 679
qlqllu Avatar asked Aug 10 '12 07:08

qlqllu


1 Answers

If you add removeCombined: true to your r.js build config the optimizer will remove (essentially not copy) all source files that were combined into your output module(s).

Alternately, if you are referring to source files that are not part of the requireJS build at all, try using fileExclusionRegExp: /^\./ in your config.

See the example full r.js config file for more details.

like image 163
rharper Avatar answered Nov 15 '22 09:11

rharper