forked from fex-team/fit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
executable file
·74 lines (66 loc) · 2.25 KB
/
webpack.config.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
67
68
69
70
71
72
73
74
var webpack = require('webpack')
var path = require('path')
var resolve = require('./resolve')
var externals = require('./externals')
var config = {
devtool: 'eval-source-map',
watch : true,
entry: [
'webpack-dev-server/client?http://localhost:8090',
'webpack/hot/only-dev-server',
'./src/index.js'
],
externals: externals,
output: {
path : __dirname + '/output',
publicPath: '/output/',
filename : 'index.js'
},
module: {
loaders: [
{
test : /\.(tsx|ts)?$/,
exclude: [/node_modules/, /demo\/lists/],
loaders: ['react-hot-loader', 'ts-loader', 'html-path-loader']
}, {
test : /\.(jsx|js|es6)?$/,
exclude: [/node_modules/, /demo\/lists/],
loaders: ['react-hot-loader', 'babel', 'html-path-loader']
}, {
test : /\.(jsx|js|es6)?$/,
include: [/node_modules/, /demo\/lists/],
loaders: ['html-path-loader']
}, {
test : /\.(scss|css)/,
exclude: [/node_modules/, /lib\/pc\/style/, /lib\/mobile\/style/],
loaders: ['style', 'css', 'autoprefixer', 'sass', 'css-path-loader']
}, {
test : /\.(scss|css)/,
include: [/node_modules/, /lib\/pc\/style/, /lib\/mobile\/style/],
loaders: ['style', 'css', 'autoprefixer', 'sass']
}, {
test : /\.(png|jpg)$/,
exclude: /node_modules/,
loaders: ['url?limit=3000&name=img/[hash:8].[name].[ext]']
}, {
test : /\.(woff|woff2|ttf|eot|svg)/,
loaders: ['url?limit=3000&name=font/[hash:8].[name].[ext]']
}, {
test : /\.json$/,
loader: 'json-loader'
}, {
test : /\.md$/,
loader: 'text-loader'
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"development"'
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: resolve
}
module.exports = config