vite-pwa / sveltekit

Zero-config PWA Plugin for SvelteKit
https://vite-pwa-org.netlify.app/frameworks/sveltekit
MIT License
308 stars 15 forks source link

Error: [InjectManifest] 'plugins' property is not expected to be here. #69

Open winston0410 opened 12 months ago

winston0410 commented 12 months ago

I tried to pass rollup plugins to my build of injectManifest like this, which is what the type is describing:

import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';

            SvelteKitPWA({
                strategies: 'injectManifest',
                // // this affect whether workbox output log and the bundle is minified or not
                // mode: "development",
                mode: "production",
                registerType: "prompt",
                injectManifest: {
                    globIgnores: ["server/**", "**/*.{css,js}"],
                    globPatterns: ["**/*.{ico,jpg,jpeg,png,svg,woff,woff2}"],
                    plugins: [
                        replace({
                            'process.env.NODE_ENV': JSON.stringify('production')
                          }),
                        terser()
                    ]
                }
            })

But then I get this error:

Error: [InjectManifest] 'plugins' property is not expected to be here.

I am using "@vite-pwa/sveltekit": "0.2.7",

winston0410 commented 12 months ago

My follow up question is, is there an option to trigger minify for injestManifest, without adding rollup plugin ourselves?