-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.config.js
46 lines (43 loc) · 1.1 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
const path = require('path');
const webpack = require('webpack');
const stylesLoader = {
test: /\.scss$/,
loaders: ['style', 'css?sourceMap', 'sass?sourceMap' ],
include: path.join(__dirname, 'app', 'stylesheets'),
};
module.exports = {
__stylesLoader: stylesLoader, // ref for webpack.config.js
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./app/scripts/app.jsx',
],
output: {
path: __dirname,
filename: 'bundle.js',
},
devtool: '#cheap-module-eval-source-map',
plugins: [
new webpack.HotModuleReplacementPlugin(),
],
module: {
loaders: [
{
test: /\.(js|jsx|es6)$/,
loaders: ['react-hot', 'babel'],
include: [
path.join(__dirname, 'node_modules', 'react-leaflet'),
path.join(__dirname, 'app', 'scripts'),
],
exclude: /node_modules\/(?!react-leaflet)/,
},
stylesLoader,
],
},
resolve: {
alias: {
stylesheets: path.resolve(__dirname, 'app', 'stylesheets'),
},
extensions: ['', '.es6', '.js', '.jsx', '.scss'],
},
};