This commit is contained in:
lei.jiang 2018-06-27 22:32:03 +08:00
parent 934132a6df
commit 6a5be79bea
2 changed files with 3 additions and 2 deletions

View File

@ -70,6 +70,7 @@ const webpackConfig = merge(baseWebpackConfig, {
favicon: resolve('favicon.ico'),
title: 'vue-element-admin',
path: config.build.assetsPublicPath + config.build.assetsSubDirectory,
pwaPath: config.build.assetsPublicPath,
minify: {
removeComments: true,
collapseWhitespace: true,

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="manifest" href="<%= htmlWebpackPlugin.options.pwaPath %>/manifest.json">
<link rel="manifest" href="<%= htmlWebpackPlugin.options.pwaPath %>manifest.json">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>vue-element-admin</title>
@ -15,7 +15,7 @@
</body>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('<%= htmlWebpackPlugin.options.pwaPath %>/sw.js').then(function(registration) {
navigator.serviceWorker.register('<%= htmlWebpackPlugin.options.pwaPath %>sw.js').then(function(registration) {
// Registration Success
console.log('[serviceWorker]: registration successful with scope: ', registration.scope)
}).catch(function(err) {