-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
51 lines (49 loc) · 1.47 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
const Clean = require('clean-webpack-plugin');
const Uglify = require('uglifyjs-webpack-plugin');
const webpack = require('webpack');
// Webpack accepts array of configurations
// https://github.com/webpack/webpack/issues/1189#issuecomment-227133370
module.exports = [
{
entry: {
'index' : './index.js',
'master': './master.js',
'slave': './slave.js',
'plugin-storage': './plugin-storage.js',
'plugin-scan': './plugin-barcode-scan.js',
'plugin-retail': './plugin-retail.js'
},
plugins: [
new Clean(['dist']),
],
output: {
filename: '[name].js',
path: __dirname + '/dist',
library: ['gravity', 'gateway', '[name]'],
libraryTarget: 'umd',
umdNamedDefine: true
}
},
{
entry: {
'index' : './index.js',
'master': './master.js',
'slave': './slave.js',
'plugin-storage': './plugin-storage.js',
'plugin-scan': './plugin-barcode-scan.js',
'plugin-retail': './plugin-retail.js'
},
plugins: [
new Uglify({
include: /\.js$/i
})
],
output: {
filename: '[name].min.js',
path: __dirname + '/dist',
library: ['gravity', 'gateway', '[name]'],
libraryTarget: 'umd',
umdNamedDefine: true
}
}
];