-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.client.config.js
58 lines (55 loc) · 1.35 KB
/
webpack.client.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
52
53
54
55
56
57
58
// hack for windows
process.env.NODE_ENV = process.env.NODE_ENV.trim();
var webpack = require('webpack');
var __STATIC_ASSETS_CDN__ = 'http://eternitycast.com';
if (process.env.NODE_ENV === 'development') {
__STATIC_ASSETS_CDN__ = 'http://localhost:8080';
}
module.exports = {
devtool: 'source-map',
entry: {
bundle: './src/client/index'
},
output: {
path: __dirname + '/build/www',
publicPath: '/',
filename: 'app.js'
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
__webpack_public_path__: JSON.stringify(__STATIC_ASSETS_CDN__ + '/'),
__SERVER__: false,
})
],
module: {
loaders: [{
test: /\.s?css$/,
loaders: ['style', 'css', 'sass?sourceMap']
}, {
test: /\.styl$/,
loaders: ['style', 'css', 'stylus']
}, {
test: /\.(gif|png|jpe?g|svg)$/,
loaders: ['url?limit=1']
}, {
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=1&minetype=application/font-woff"
}, {
test: /\.(ttf|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=1"
}, {
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
babelrc: false,
presets: ['es2015', 'react', 'stage-0'],
plugins: ["transform-async-to-generator", "transform-decorators-legacy"]
}
}]
}
};