javascript - How to specify which Require.js modules are compressed with the optimizer and which are not? -
Using the Require.js adapter with Node.js, I only want to include some of my project files. How do I specify which file I want to compress? This is my current node. Js script is:
var requirejs = require ('requirejs'); Var config = {baseUrl: '/ generic', name: 'main', outside: '/ compressed'}; Needjs.optimize (config, function (buildResponse) {// buildResponse, is a text output of only module // Load the created file for content. // Use config.out to get customized file content. Content = Fs.readFileSync (config.out, 'utf8');}); I want to compress files in general. The main also is common in such files that are dependencies which I do not want to compress. How does the adapter choose which file to combine?
I do not think the Require.js build system works like this; This is like an all-or-normal operation from the site ():
The build system will then detect the dependency for the main.js and give them an API directory-build / script / main.js file Will inject.
However, there are several options that you can provide:
And depending on it, your best bet is that you Modules do not want to be in the form of "stub" module:
Specify the module to stub out in the optimized file. The adapter will use the source version of these modules for dependency tracing and for the plugin use, but when writing the text in an optimized layer, these modules are
Comments
Post a Comment