-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.frontend.js
54 lines (50 loc) · 1.15 KB
/
webpack.config.frontend.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
import path from 'path'
import webpack from 'webpack'
import postcssNested from 'postcss-nested'
import postcssCssnext from 'postcss-cssnext'
let root = __dirname
if (__dirname.endsWith('/dev')) {
root = path.join(__dirname, '../')
}
const config = {
entry: [
'webpack-hot-middleware/client',
'babel-polyfill',
'./client/index.jsx',
],
output: {
path: path.join(root, 'dev'),
filename: 'frontend.js',
publicPath: 'http://127.0.0.1:3000/',
},
resolve: {
extensions: ['', '.jsx', '.js', '.css'],
},
module: {
loaders: [{
test: /(\.js|\.jsx)$/,
exclude: /(node_modules)/,
loader: 'babel',
}, {
test: /\.css$/,
loader: 'style?sourceMap!css?sourceMap!postcss?sourceMap',
}, {
test: /\.(png|jpg|jpeg)$/,
loader: 'url?limit=3072',
}],
},
externals: {
falcor: 'falcor',
'falcor-http-datasource': 'falcor.HttpDataSource',
},
postcss: [postcssNested, postcssCssnext],
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
],
devtool: 'inline-source-map',
}
export default config