js-beautify/webpack.config.js

58 lines
1.5 KiB
JavaScript
Raw Normal View History

var path = require('path');
2018-07-05 22:45:56 +00:00
var legacy = {
mode: 'none',
entry: {
beautify_js: './js/src/javascript/index.js',
beautify_css: './js/src/css/index.js',
beautify_html: './js/src/html/index.js'
},
resolve: {
modules: [ path.resolve(__dirname, "js/src") ]
},
output: {
2018-07-05 22:45:56 +00:00
library: 'legacy_[name]',
filename: 'legacy_[name].js',
2018-08-31 20:02:44 +00:00
path: path.resolve(__dirname, 'build/legacy')
}
};
2018-07-05 22:45:56 +00:00
var dist_full = {
entry: './js/src/index.js',
mode: 'none',
resolve: {
modules: [ path.resolve(__dirname, "js/src") ]
},
2018-07-12 07:13:21 +00:00
devtool: 'source-map',
output: {
2018-07-05 22:45:56 +00:00
library: 'beautifier',
libraryTarget: 'umd',
umdNamedDefine: true,
filename: 'beautifier.js',
2018-07-12 22:21:51 +00:00
path: path.resolve(__dirname, 'js/lib'),
// Workaround for https://github.com/webpack/webpack/issues/6525
globalObject: "typeof self !== 'undefined' ? self : typeof windows !== 'undefined' ? window : typeof global !== 'undefined' ? global : this"
}
};
2018-07-05 22:45:56 +00:00
var dist_prod = {
entry: './js/src/index.js',
2018-07-05 22:45:56 +00:00
mode: 'production',
2018-06-29 03:17:01 +00:00
resolve: {
modules: [ path.resolve(__dirname, "js/src") ]
},
2018-07-12 07:13:21 +00:00
devtool: 'source-map',
output: {
library: 'beautifier',
libraryTarget: 'umd',
umdNamedDefine: true,
2018-07-05 22:45:56 +00:00
filename: 'beautifier.min.js',
2018-07-12 22:21:51 +00:00
path: path.resolve(__dirname, 'js/lib'),
// Workaround for https://github.com/webpack/webpack/issues/6525
globalObject: "typeof self !== 'undefined' ? self : typeof windows !== 'undefined' ? window : typeof global !== 'undefined' ? global : this"
}
};
2018-07-05 22:45:56 +00:00
module.exports = [dist_full, dist_prod, legacy];