-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.babel.js
63 lines (55 loc) · 1.3 KB
/
webpack.config.babel.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
52
53
54
55
56
57
58
59
60
61
62
63
import path from 'path';
import webpack from 'webpack';
import alias from './alias';
const isProduction = process.env.NODE_ENV === 'production';
const config = {
entry: './app/main.js',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules\/(?!whs)|bower_components)/,
loader: 'babel-loader',
query: {
plugins: [
'add-module-exports',
'transform-decorators-legacy',
'transform-class-properties',
'transform-object-rest-spread',
['transform-runtime', {helpers: false, polyfill: false, regenerator: true}]
]
}
},
{
test: /\.(glsl|frag|vert)$/, loader: 'raw-loader', exclude: /node_modules/
},
{
test: /\.(glsl|frag|vert)$/, loader: 'glslify-loader', exclude: /node_modules/
}
]
},
plugins: isProduction
? [
new webpack.LoaderOptionsPlugin({
minimize: true
}),
new webpack.optimize.UglifyJsPlugin()
]
: [],
output: {
path: path.join(__dirname, './build/'),
filename: 'bundle.js'
},
devServer: {
publicPath: '/build/',
stats: { chunks: true }
},
resolve: {
alias,
symlinks: false,
modules: [path.resolve('node_modules')]
}
};
export {
config as default
};