-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
43 lines (42 loc) · 1.08 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 { GuessPlugin } = require('guess-webpack');
module.exports = {
mode : "development",
context: __dirname + '/src',
entry: {
bundle: ["./index.js"]
},
output: {
filename: 'guess-bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
]
},
plugins: [
new GuessPlugin(
{ GA: '103185238',
debug: true,
runtime: {
basePath: '',
// true > PrefetchPlugin 、false > PrefetchAotPlugin の切替を行う
delegate: true,
// 回線ごとの閾値の指定
prefetchConfig: {
'4g': 0.15,
'3g': 0.25,
'2g': 0.45,
'slow-2g': 0.6
}
}
})
]
}