-
Notifications
You must be signed in to change notification settings - Fork 12
/
webpack.config.js
40 lines (38 loc) · 997 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
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const isdev = (process.env['NODE_ENV'] || 'development') === 'development';
module.exports = {
mode: isdev ? 'development' : 'production',
watch: process.env['WATCH'] === 'true',
entry: [
path.join(__dirname, 'src', 'index.js')
],
devtool: isdev ? 'eval' : 'source-map',
output: {
path: path.join(__dirname, 'docs'),
pathinfo: true,
filename: 'bundle.js',
publicPath: ''
},
module: {
rules: [
{
test: /\.js$/,
include: path.join(__dirname, 'src'),
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
loader: 'style-loader!css-loader!postcss-loader'
},
{
test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader',
}
]
},
plugins: [
new CopyWebpackPlugin([ { from: 'static', to: 'static' } ]),
]
};