-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathwebpack.config.js
46 lines (39 loc) · 921 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
42
43
44
45
46
var path = require('path');
const sourceReg = /src\//i;
function matchSources(sourcePath) {
return sourceReg.test(path.relative(__dirname, sourcePath));
}
const babelLoader = {
test: /\.js$/,
loader: 'babel',
//include: matchSources,
exclude: '/node_modules/',
query: {
presets: ['react', 'es2015', 'stage-0'],
},
};
module.exports = {
entry: {
panel: './src/panel.js',
},
postcss: [
require('postcss-import'),
],
module: {
loaders: [
{
test: /\.(png|jpg|gif|eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=[name].[hash].[ext]',
exclude: /node_modules/,
},
babelLoader,
{ test: /\.css$/, loaders: ['style', 'css?module&localIdentName=[name]__[local]___[hash:base64:5]', 'postcss'] },
],
},
output: {
path: __dirname + '/build',
filename: '[name].js',
},
devtool: 'cheap-module-source-map',
debug: true,
};