-
Notifications
You must be signed in to change notification settings - Fork 34
/
webpack.config.js
47 lines (45 loc) · 1.19 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
var path = require('path');
var webpack = require('webpack');
var corePath = path.resolve(__dirname, 'core');
var node_modules_dir = path.resolve(__dirname, 'node_modules');
var reactPath = path.resolve(node_modules_dir, 'react', 'dist');
var buildPath = path.resolve(__dirname, 'build');
var config = {
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
path.resolve(corePath, '_main.jsx')
],
context: corePath,
devtool: 'eval-source-map',
output: {
filename: 'blog.js',
path: buildPath,
publicPath: '/public/'
},
resolve: {
alias: {
'react/lib/ReactMount': path.resolve(node_modules_dir, 'react', 'lib', 'ReactMount'),
'react/addons': path.resolve(reactPath, 'react.min.js')
}
},
module: {
noParse: [reactPath],
loaders: [{
test: /\.jsx$/,
loaders: ['react-hot', 'babel'],
exclude: [node_modules_dir]
}, {
test: /\.md$/,
loader: 'raw'
}, {
test: /\.css$/,
loader: 'style!css'
}, {
test: /\.json$/,
loader: 'json'
}]
},
plugins: [new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin()]
};
module.exports = config;