-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
65 lines (58 loc) · 1.43 KB
/
webpack.dev.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
59
60
61
62
63
64
65
'use strict';
const path = require('path');
const webpack = require('webpack');
const setting = require('./settings.config.js');
const copyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'eval',
entry: [
require.resolve('./polyfills'),
'webpack-hot-middleware/client',
'./src/web/index'
],
resolve: {
extensions: ['', '.js', '.jsx'],
modulesDirectories: ['node_modules', 'web']
},
output: {
path: setting.appPath,
filename: 'js/main.js',
publicPath: setting.publicPath
},
plugins: [
new copyWebpackPlugin([
{ from: 'static' }
]),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{
test: /\.js?$/,
exclude: /(node_modules|bower_components)/,
loaders: ['react-hot', 'babel-loader']
},
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loaders: ['react-hot', 'babel-loader']
},
{
test: /\.scss/,
loader: "style-loader!css-loader!sass-loader"
},
{
test: /\.png$/,
loader: 'file'
},
{
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'file'
},
{ test: /\.css$/, loader: "style-loader!css-loader" },
{ test: /\.png$/, loader: "url-loader?limit=100000" },
{ test: /\.jpg$/, loader: "file-loader" }
]
}
};