-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack-min.config.js
41 lines (39 loc) · 1.18 KB
/
webpack-min.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
const path = require('path');
const webpack = require('webpack');
const PATHS = {
src: path.join(__dirname, 'dist', 'index.js'),
build: path.join(__dirname, 'build')
};
module.exports = {
entry: PATHS.src,
output: {
path: PATHS.build,
filename: "bundle.min.js",
library: "EToken",
libraryTarget: "var"
},
module: {
preLoaders: [
{ test: /\.json/, loader: "json-loader" }
],
loaders: [
{
test: /\.js/,
exclude: /node_modules\/(?!(ethereumjs-tx|web3-provider-engine|ethereumjs-util|browserify-sha3|rlp|eth-block-tracker|eth-json-rpc-filters|json-rpc-engine)\/).*/,
loader: "babel-loader",
query: {
presets: [['@babel/preset-env', { 'targets': 'chrome > 50' }]],
plugins: ['@babel/plugin-transform-object-assign'],
}
}
]
},
node: {
fs: "empty"
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
// new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
]
};