-
Notifications
You must be signed in to change notification settings - Fork 21
/
webpack.config.js
51 lines (49 loc) · 1.16 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
/* eslint import/no-extraneous-dependencies: 0 */
const webpack = require('webpack');
const path = require('path');
const isProd = process.env.NODE_ENV === 'production';
module.exports = {
entry: [
'babel-polyfill',
path.resolve(__dirname, 'src/index.js'),
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'phaser-list-view.js',
publicPath: './dist/',
},
resolve: {
extensions: ['', '.js'],
root: __dirname,
alias: {
src: path.join(__dirname, 'src'),
},
},
module: {
loaders: [{
test: /\.js?$/,
loader: 'babel',
exclude: /node_modules/,
include: path.resolve(__dirname, 'src'),
}]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
APP_ENV: JSON.stringify(process.env.APP_ENV),
},
}),
new webpack.ProvidePlugin({
Promise: 'imports?this=>global!exports?global.Promise!es6-promise',
}),
new webpack.optimize.OccurenceOrderPlugin(),
].concat(isProd ? [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
minimize: true,
compress: {
warnings: false,
},
}),
] : [])
};