-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
66 lines (57 loc) · 1.38 KB
/
webpack.dev.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
64
65
66
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var demoPath = path.join(__dirname, 'demo');
var srcPath = path.join(__dirname, 'src');
module.exports = {
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080',
'webpack/hot/only-dev-server',
path.resolve(demoPath, 'index.js')
],
output: {
path: path.resolve(demoPath, 'bundle'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.json$/,
loaders: ['json'],
include: path.join(__dirname, 'package.json')
},
{
test: /\.jsx?$/,
loaders: ['react-hot','babel'],
include: [demoPath, srcPath]
},
{
test: /\.less$/,
loader: 'style!css!less',
include: demoPath
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loader:'file',
include: demoPath
},
{
test: /\.md$/,
loader:'html!markdown?gfm=false',
include: path.join(__dirname, 'README.md')
}
]
},
plugins: [
new webpack.DefinePlugin({
__DEV__ : (process.env.NODE_ENV !== 'production')
}),
new webpack.DefinePlugin({
GA_TRACKING_CODE: JSON.stringify('UA-59444321-3')
}),
new HtmlWebpackPlugin({
title: 'React Plan',
template: path.join(demoPath, 'index.tpl.html')
})
]
};