forked from beautifier/js-beautify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
57 lines (52 loc) · 1.53 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var path = require('path');
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: {
library: 'legacy_[name]',
filename: 'legacy_[name].js',
path: path.resolve(__dirname, 'build/legacy')
}
};
var dist_full = {
entry: './js/src/index.js',
mode: 'none',
resolve: {
modules: [ path.resolve(__dirname, "js/src") ]
},
devtool: 'source-map',
output: {
library: 'beautifier',
libraryTarget: 'umd',
umdNamedDefine: true,
filename: 'beautifier.js',
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"
}
};
var dist_prod = {
entry: './js/src/index.js',
mode: 'production',
resolve: {
modules: [ path.resolve(__dirname, "js/src") ]
},
devtool: 'source-map',
output: {
library: 'beautifier',
libraryTarget: 'umd',
umdNamedDefine: true,
filename: 'beautifier.min.js',
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"
}
};
module.exports = [dist_full, dist_prod, legacy];