-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
58 lines (55 loc) · 1.52 KB
/
webpack.config.js
File metadata and controls
58 lines (55 loc) · 1.52 KB
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
58
var webpack = require('webpack');
var path = require('path');
var env = process.env.BUILD_ENV;
var config = {
entry: env === 'production' ? [
path.resolve('./src/extras/polyfills.js'),
path.resolve('./src/sciplay.js')
] :
[
// 'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/dev-server',
path.resolve('./src/extras/polyfills.js'),
path.resolve('./src/sciplay.js')
],
devtool: env === 'production' ? null : 'source-map',
externals: {
polyfill: "./src/extras/polyfills.js"
},
output: {
path: path.resolve('./dist'),
filename: env === 'production' ? 'sciplay.js' : 'sciplay.dev.js',
library: 'sciplay',
libraryTarget: 'umd',
umdNamedDefine: true
},
resolve: {
root: __dirname,
modulesDirectories: [
'node_modules'
],
extensions: ['', '.js']
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader'
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'eslint-loader'
},
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
// plugins: env === 'production' ?
// [new webpack.optimize.UglifyJsPlugin({minimize: true})] :
// []
};
module.exports = config;