sw building seem to be working fine now?
This commit is contained in:
parent
8824049f28
commit
fead727d78
4 changed files with 9 additions and 164 deletions
|
|
@ -12,6 +12,7 @@ import { getCommitHash } from './build/commit_hash.js'
|
|||
import copyPlugin from './build/copy_plugin.js'
|
||||
import emojisPlugin from './build/emojis_plugin.js'
|
||||
import {
|
||||
devSwPlugin,
|
||||
swMessagesPlugin,
|
||||
} from './build/sw_plugin.js'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
|
|
@ -109,7 +110,7 @@ export default defineConfig(async ({ mode, command }) => {
|
|||
},
|
||||
}
|
||||
|
||||
const swSrc = 'src/sw-pleroma.js'
|
||||
const swSrc = 'src/sw.js'
|
||||
const swDest = 'sw-pleroma.js'
|
||||
const alias = {
|
||||
src: '/src',
|
||||
|
|
@ -160,23 +161,7 @@ export default defineConfig(async ({ mode, command }) => {
|
|||
),
|
||||
}),
|
||||
swMessagesPlugin(),
|
||||
VitePWA({
|
||||
strategies: 'injectManifest',
|
||||
srcDir: 'src',
|
||||
filename: 'sw-pleroma.js',
|
||||
manifest: false,
|
||||
injectRegister: null,
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
type: 'classic',
|
||||
},
|
||||
injectManifest: {
|
||||
injectionPoint: undefined,
|
||||
buildPlugins: {
|
||||
vite: [swMessagesPlugin()],
|
||||
},
|
||||
}
|
||||
}),
|
||||
devSwPlugin({ swSrc, swDest }),
|
||||
],
|
||||
optimizeDeps: {
|
||||
// For unknown reasons, during vitest, vite will re-optimize the following
|
||||
|
|
@ -221,6 +206,7 @@ export default defineConfig(async ({ mode, command }) => {
|
|||
devtools: {}, // enable devtools mode
|
||||
input: {
|
||||
main: 'index.html',
|
||||
sw: 'src/sw.js',
|
||||
},
|
||||
output: {
|
||||
entryFileNames(chunkInfo) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue