-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
66 lines (66 loc) · 1.49 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
module.exports = (env, argv) => ({
devServer: {
contentBase: './dist',
historyApiFallback: true,
host: '127.0.0.1',
port: 7000
},
entry: {
app: ['@babel/polyfill', 'whatwg-fetch', './src/index.js'],
vendor: ['@babel/polyfill', 'react', 'react-dom', 'firebase']
},
resolve: {
alias: {
components: __dirname + "/src/components",
contexts: __dirname + "/src/contexts",
js: __dirname + "/src/js",
images: __dirname + "/src/images",
pages: __dirname + "/src/pages",
styles: __dirname + "/src/styles"
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}, {
test: /\.(woff2?|eot|svg|ttf|md|jpg|png)$/,
exclude: /node_modules/,
use: [
{
loader: 'file-loader',
options: {
name: '[hash].[ext]',
publicPath: argv.mode === 'development'
? '/compiled/'
: 'https://apkallufalls.com/compiled/'
}
}
]
}
]
},
output: {
filename: '[name].min.js',
path: __dirname + '/dist/compiled',
chunkFilename: '[name].min.js',
publicPath: '/',
},
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
chunks: 'initial',
name: 'vendor',
test: 'vendor',
enforce: true
},
}
},
runtimeChunk: true
}
});