generated from gzzo/react-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.babel.js
49 lines (42 loc) · 1.05 KB
/
webpack.common.babel.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
47
48
49
import path from 'path'
import webpack from 'webpack'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import InlineSourcePlugin from 'html-webpack-inline-source-plugin'
export default {
context: path.resolve(__dirname, 'src'),
entry: ['react-hot-loader/patch', 'whatwg-fetch', './index.js'],
output: {
filename: '[name].[contenthash].js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
},
optimization: {
runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
vendors: false,
vendor: {
name: 'vendor',
chunks: 'initial',
test: /node_modules/,
priority: 20,
},
},
},
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new HtmlWebpackPlugin({
template: 'index.html',
inlineSource: 'runtime.+\\.js',
}),
new InlineSourcePlugin(),
],
resolve: {
extensions: ['.js', '.jsx', '.scss'],
modules: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules'),
],
},
}