forked from gajus/babel-plugin-react-css-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (39 loc) · 893 Bytes
/
webpack.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
/* eslint-disable filenames/match-regex, import/no-commonjs */
const path = require('path');
const context = path.resolve(__dirname, 'src');
module.exports = {
context,
entry: './index.js',
module: {
loaders: [
{
include: path.resolve(__dirname, './src'),
loaders: [
'style-loader',
'css-loader?importLoader=1&modules&localIdentName=[path]___[name]__[local]___[hash:base64:5]'
],
test: /\.css$/
},
{
include: path.resolve(__dirname, './src'),
loader: 'babel-loader',
query: {
plugins: [
'@babel/transform-react-jsx',
[
'react-css-modules',
{
context
}
]
]
},
test: /\.js$/
}
]
},
output: {
filename: '[name].js'
},
stats: 'minimal'
};