UglifyJS adapter for Customize
npm install customize-engine-uglify
The following example demonstrates how to use this module:
var customize = require('customize')
// Load files from one directory and merge with a second one
customize()
.registerEngine('uglify', require('customize-engine-uglify'))
// Add two javascript files
.merge({
uglify: {
files: {
'a-browser-lib.js': require.resolve('./module1/a-browser-lib.js'),
'another-browser-lib.js': require.resolve('./module1/another-browser-lib.js')
},
dependencies: {
'a-browser-lib.js': [ 'another-browser-lib.js' ]
}
}
})
// Add another js file overriding "a-browser-lib.js"
.merge({
uglify: {
files: {
'a-browser-lib.js': require.resolve('./module2/overriding-browser-lib.js')
}
}
})
.run()
.done(console.log)
This will generate the following output
{ uglify:
{ 'bundle.js': 'console.log("another-browser-lib"),console.log("overriding-browser-lib");\n//# sourceMappingURL=bundle.js.map',
'bundle.js.map': '{"version":3,"sources":["/home/nknappmeier/projects/bootprint/customize-engine-uglify/examples/module1/another-browser-lib.js","/home/nknappmeier/projects/bootprint/customize-engine-uglify/examples/module2/overriding-browser-lib.js"],"names":["console","log"],"mappings":"AAAAA,QAAQC,IAAI,uBCAZD,QAAQC,IAAI","file":"bundle.js"}' } }
customize-engine-uglify
is published under the MIT-license.
See LICENSE.md for details.
For release notes, see CHANGELOG.md
See CONTRIBUTING.md.