UNPKG

893 BJavaScriptView Raw
1/* eslint-disable filenames/match-regex, import/no-commonjs */
2
3const path = require('path');
4const context = path.resolve(__dirname, 'src');
5
6module.exports = {
7 context,
8 entry: './index.js',
9 module: {
10 loaders: [
11 {
12 include: path.resolve(__dirname, './src'),
13 loaders: [
14 'style-loader',
15 'css-loader?importLoader=1&modules&localIdentName=[path]___[name]__[local]___[hash:base64:5]'
16 ],
17 test: /\.css$/
18 },
19 {
20 include: path.resolve(__dirname, './src'),
21 loader: 'babel-loader',
22 query: {
23 plugins: [
24 '@babel/transform-react-jsx',
25 [
26 'react-css-modules',
27 {
28 context
29 }
30 ]
31 ]
32 },
33 test: /\.js$/
34 }
35 ]
36 },
37 output: {
38 filename: '[name].js'
39 },
40 stats: 'minimal'
41};