fixed favicons and added service-worker
Signed-off-by: Pascal Syma <pascal@syma.dev>
This commit is contained in:
Generated
+2059
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -38,7 +38,8 @@
|
|||||||
"webpack": "^4.41.2",
|
"webpack": "^4.41.2",
|
||||||
"webpack-cli": "^3.3.10",
|
"webpack-cli": "^3.3.10",
|
||||||
"webpack-dev-server": "^3.9.0",
|
"webpack-dev-server": "^3.9.0",
|
||||||
"webpack-merge": "^4.2.2"
|
"webpack-merge": "^4.2.2",
|
||||||
|
"workbox-webpack-plugin": "^5.1.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"phaser": "^3.20.1",
|
"phaser": "^3.20.1",
|
||||||
|
|||||||
@@ -37,4 +37,10 @@ const config = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
window.addEventListener('load', () => {
|
||||||
|
navigator.serviceWorker.register('./service-worker.js').then();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const game = new Phaser.Game(config);
|
const game = new Phaser.Game(config);
|
||||||
|
|||||||
+5
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020. Pascal Syma <pascal@syma.dev>
|
* Copyright (c) 2020. Antonio Martinez Casadesus and Pascal Syma.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -46,8 +46,11 @@ module.exports = {
|
|||||||
logo: './public/favicon.png',
|
logo: './public/favicon.png',
|
||||||
publicPath: "./",
|
publicPath: "./",
|
||||||
favicons: {
|
favicons: {
|
||||||
appName: 'mi2mario',
|
manifestRelativePaths: true,
|
||||||
|
start_url: "../",
|
||||||
|
appName: 'MI2Mario',
|
||||||
appDescription: 'MI2 Mario',
|
appDescription: 'MI2 Mario',
|
||||||
|
appShortName: "mi2mario",
|
||||||
developerName: 'Pascal Syma',
|
developerName: 'Pascal Syma',
|
||||||
developerURL: "https://syma.dev",
|
developerURL: "https://syma.dev",
|
||||||
background: '#000',
|
background: '#000',
|
||||||
|
|||||||
+9
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020. Pascal Syma <pascal@syma.dev>
|
* Copyright (c) 2020. Antonio Martinez Casadesus and Pascal Syma.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -7,6 +7,7 @@ const merge = require("webpack-merge");
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const base = require("./base");
|
const base = require("./base");
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
const TerserPlugin = require("terser-webpack-plugin");
|
||||||
|
const WorkboxPlugin = require('workbox-webpack-plugin');
|
||||||
|
|
||||||
module.exports = merge(base, {
|
module.exports = merge(base, {
|
||||||
mode: "production",
|
mode: "production",
|
||||||
@@ -28,5 +29,11 @@ module.exports = merge(base, {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
plugins: [
|
||||||
|
new WorkboxPlugin.GenerateSW({
|
||||||
|
clientsClaim: true,
|
||||||
|
skipWaiting: true,
|
||||||
|
}),
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user