исправляет проблемы с PWA из cписка Lighthouse
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
cb1fcaee05
commit
a557f77d9c
2956
package-lock.json
generated
2956
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,8 @@
|
||||
"prestart": "node ./scripts/symlink.js",
|
||||
"start": "npx @11t/eleventy --serve",
|
||||
"prebuild": "node ./scripts/symlink.js",
|
||||
"build": "cross-env NODE_ENV=production npx @11t/eleventy",
|
||||
"build": "cross-env NODE_ENV=production npx @11t/eleventy && npm run build:sw",
|
||||
"build:sw": "workbox generateSW workbox-config.js",
|
||||
"stylelint": "stylelint 'src/**/*.css'",
|
||||
"eslint": "eslint src"
|
||||
},
|
||||
@ -33,7 +34,9 @@
|
||||
"simple-git-hooks": "^2.7.0",
|
||||
"stylelint": "^14.8.2",
|
||||
"stylelint-config-standard": "^25.0.0",
|
||||
"tailwindcss": "^3.0.24"
|
||||
"tailwindcss": "^3.0.24",
|
||||
"workbox-build": "^6.5.3",
|
||||
"workbox-cli": "^6.5.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"alpinejs": "^3.10.2",
|
||||
|
@ -31,6 +31,8 @@ module.exports = (eleventyConfig) => {
|
||||
}
|
||||
}))
|
||||
|
||||
res[res.length - 1].purpose = 'maskable'
|
||||
|
||||
return JSON.stringify(res)
|
||||
})
|
||||
}
|
||||
|
@ -4,4 +4,6 @@ import Fuse from 'fuse.js'
|
||||
window.Fuse = Fuse
|
||||
window.Alpine = Alpine
|
||||
|
||||
if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/sw.js') }
|
||||
|
||||
Alpine.start()
|
||||
|
@ -6,6 +6,7 @@
|
||||
<title>{{ title or metadata.title }}</title>
|
||||
<meta name="description" content="{{ description or metadata.description }}">
|
||||
<meta name="generator" content="{{ eleventy.generator }}">
|
||||
<meta name="theme-color" content="#fff"/>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="stylesheet" href="/css/index.css">
|
||||
{% favicon 'src/images/favicon.svg' %}
|
||||
|
@ -4,6 +4,7 @@
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#fff",
|
||||
"theme_color": "#fff",
|
||||
"description": "Вики с различными полезными статьями",
|
||||
"icons": {% manifest_icons 'src/images/favicon.svg', 48, 72, 96, 144, 148, 512 %}
|
||||
}
|
11
workbox-config.js
Normal file
11
workbox-config.js
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
globDirectory: 'dist/',
|
||||
globPatterns: [
|
||||
'**/*.{png,css,ico,svg,ttf,woff,woff2,js,json}'
|
||||
],
|
||||
swDest: 'dist/sw.js',
|
||||
ignoreURLParametersMatching: [
|
||||
/^utm_/,
|
||||
/^fbclid$/
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user