forked from sanjay1909/cssmodulesdemo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
35 lines (34 loc) · 1.14 KB
/
webpack.config.js
File metadata and controls
35 lines (34 loc) · 1.14 KB
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
/*
./webpack.config.js
*/
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './client/index.js',
output: {
path: path.resolve(__dirname,'dist'),
filename: 'demo.js'
},
devtool: '#inline-source-map',
module: {
loaders: [
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.jsx$/, loader: 'babel-loader', exclude: /node_modules/ },
{ test: /\.md$/, loader: 'raw-loader', exclude: /node_modules/ },
{ test: /\.normal.css$/, loader: ['style-loader','css-loader'] },//Loaders are processed in reverse array order. That means css-loader will run before style-loader
{ test: /\.module.css$/, use: ['style-loader', {loader: 'css-loader', options: { modules: true }, }],
}
]
},
resolve: {
extensions: ['.js', '.jsx']
},
plugins: [
new webpack.HotModuleReplacementPlugin() // Enable HMR
],
devServer: {
hot: true, // Tell the dev-server we're using HMR
contentBase: path.resolve(__dirname, 'dist'),
publicPath: '/'
}
}