-
Notifications
You must be signed in to change notification settings - Fork 10
/
webpack.config.js
43 lines (38 loc) · 1.43 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
/*eslint-env node*/
var path = require('path');
var webpack = require('webpack');
var argv = require('yargs')
.default('dev', false)
.default('min', false)
.argv;
var postfix = argv.min && '.min' || argv.dev && '.dev' || '';
var plugins = [
new webpack.BannerPlugin(
'DevExtreme-Intl v' + require('./package.json').version
)
];
if(argv.min) {
plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: { screw_ie8: true },
mangle: { screw_ie8: true }
}));
}
module.exports = {
context: path.resolve(__dirname),
entry: './src/index',
output: {
path: path.resolve(__dirname + '/dist'),
filename: './devextreme-intl' + postfix + '.js',
libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'devextreme-intl:///[resource-path]',
devtoolFallbackModuleFilenameTemplate: 'devextreme-intl:///[resource-path]?[hash]'
},
externals: {
'devextreme/core/config': { root: [ 'DevExpress', 'config' ], amd: 'devextreme/core/config', commonjs2: 'devextreme/core/config' },
'devextreme/localization': { root: [ 'DevExpress', 'localization' ], amd: 'devextreme/localization', commonjs2: 'devextreme/localization' },
'devextreme/core/version': { root: [ 'DevExpress', 'VERSION' ], amd: 'devextreme/core/version', commonjs2: 'devextreme/core/version' }
},
plugins: plugins,
devtool: argv.dev ? 'eval' : null,
watch: argv.dev
};