mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-19 08:01:11 +00:00
switch to PWA injectManifest strategy
This commit is contained in:
parent
6ac26c81f4
commit
46be26012d
|
@ -66,8 +66,6 @@ const config: UserConfigFnPromise = async ({ mode, command }) => {
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
commonjsOptions: { transformMixedEsModules: true },
|
commonjsOptions: { transformMixedEsModules: true },
|
||||||
outDir: path.resolve(__dirname, '.dist'),
|
|
||||||
emptyOutDir: true,
|
|
||||||
manifest: 'manifest.json',
|
manifest: 'manifest.json',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
|
@ -118,7 +116,9 @@ const config: UserConfigFnPromise = async ({ mode, command }) => {
|
||||||
MastodonServiceWorkerLocales(),
|
MastodonServiceWorkerLocales(),
|
||||||
VitePWA({
|
VitePWA({
|
||||||
srcDir: 'mastodon/service_worker',
|
srcDir: 'mastodon/service_worker',
|
||||||
filename: 'sw.js',
|
strategies: 'injectManifest',
|
||||||
|
// Force output in the prod directory so the symlink works.
|
||||||
|
outDir: path.resolve(__dirname, 'public/packs'),
|
||||||
manifest: false,
|
manifest: false,
|
||||||
injectRegister: null,
|
injectRegister: null,
|
||||||
injectManifest: {
|
injectManifest: {
|
||||||
|
@ -128,6 +128,8 @@ const config: UserConfigFnPromise = async ({ mode, command }) => {
|
||||||
MastodonServiceWorkerLocales(),
|
MastodonServiceWorkerLocales(),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
// Because we move the output dir, we need to scan for assets in the original output directory.
|
||||||
|
globDirectory: env.VITE_RUBY_PUBLIC_OUTPUT_DIR ?? 'public',
|
||||||
globIgnores: [
|
globIgnores: [
|
||||||
// Do not preload those files
|
// Do not preload those files
|
||||||
'intl/*.js',
|
'intl/*.js',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user