override entrypoint, automatically load serviceworker
This commit is contained in:
parent
aeebfd82db
commit
31cb962156
@ -155,7 +155,8 @@ let
|
||||
<meta name="msapplication-config" content="/appdata/browserconfig.xml">
|
||||
<meta name="theme-color" content="${themeColor}">
|
||||
</head>
|
||||
<body></body>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
'';
|
||||
in
|
||||
|
@ -75,6 +75,13 @@ prerenderOpts = (width, height, name) => ({
|
||||
|
||||
module.exports = {
|
||||
target: 'web',
|
||||
entry: magicFile(`
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => navigator.serviceWorker.register('/sw.js'));
|
||||
}
|
||||
|
||||
require('${process.env.PWD}/src/index.js')
|
||||
`),
|
||||
output: {
|
||||
filename: 'main.js',
|
||||
path: path.join(__dirname, 'dist'),
|
||||
|
Loading…
Reference in New Issue
Block a user