-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.dev.js
51 lines (50 loc) · 1.3 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
import webpack from 'webpack';
import path from 'path';
const ExtractTextPlugin = require('extract-text-webpack-plugin');
let HtmlWebpackPlugin = require('html-webpack-plugin');
export default {
devtool: 'inline-source-map',
entry: [
'babel-polyfill',
'webpack-hot-middleware/client?reload=true', //note that it reloads the page if hot module reloading fails.
path.resolve(__dirname, './client/src/index.js')
],
output: {
path: __dirname + 'client/dist', // Note: Physical files are only output by the production build task `npm run build`.
publicPath: '/static/',
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.jsx']
},
devServer: {
contentBase: path.resolve(__dirname, 'client/src')
},
node: {
fs: 'empty'
},
plugins: [
new ExtractTextPlugin("styles.css"),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new HtmlWebpackPlugin()
],
module: {
loaders: [
{
test: /\.js$/,
include: path.join(__dirname, 'client/src'),
loaders: ['babel-loader'],
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: "babel-loader"
},
{
test: /\.(scss|css)$/,
loaders: ['style-loader','css-loader', 'sass-loader']
}
]
}
};