-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
43 lines (41 loc) · 1.02 KB
/
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
const webpack = require('webpack');
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const config = {
entry: ['react-hot-loader/patch', './client/src/index.jsx'],
output: {
path: path.resolve(__dirname, 'client', 'dist'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
use: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
],
},
devServer: {
static: {
directory: './client/dist',
},
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
plugins: [
new CopyPlugin({
patterns: [{ from: 'client/src/index.html' }],
}),
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/),
new CleanWebpackPlugin(),
new webpack.WatchIgnorePlugin({ paths: ['client/dist/index.html'] }),
],
};
module.exports = config;