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