Do not copy the source file when optimizing with requirejs

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

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

+5
source share
3 answers

If you add removeCombined: truer.js to the build configuration, the optimizer will delete (in fact, not copy) all the source files that have been merged into your output module.

Alternatively, if you are referencing source files that are not part of the requireJS assembly at all, try using fileExclusionRegExp: /^\./in your configuration.

. r.js.

+10

, :

fileExclusionRegExp

, cssmin concat/minify , requirejs , foo, :

fileExclusionRegExp: /css|foo/

.

0

use this configuration:

keepBuildDir: true,

it may contain an output directory

detail: https://github.com/jrburke/r.js/blob/master/build/example.build.js#L70

-1
source

All Articles