-
Notifications
You must be signed in to change notification settings - Fork 134
/
webpack.config.js
42 lines (39 loc) · 1013 Bytes
/
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
const webpack = require('webpack');
const minimize = process.argv.indexOf('--minimize') !== -1;
module.exports = (env, argv) => {
argv.mode = argv.mode || 'production';
const plugins = [];
const filename = (argv.mode === 'production') ? 'zingtouch.min.js' : 'zingtouch.js';
const config = {
mode: argv.mode,
entry: './src/core/main.js',
output: {
filename: filename,
library: 'ZingTouch',
libraryTarget: 'umd',
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
plugins: plugins,
};
config.output.filename = filename;
plugins.push(new webpack.BannerPlugin(`
ZingTouch v${process.env.npm_package_version}
Author: ZingChart http://zingchart.com
License: MIT`
));
return config;
};