Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can the build target option be added to the generateInjectManifest method? #625

Closed
Eleg-i opened this issue Dec 19, 2023 · 0 comments · Fixed by #629
Closed

Can the build target option be added to the generateInjectManifest method? #625

Eleg-i opened this issue Dec 19, 2023 · 0 comments · Fixed by #629

Comments

@Eleg-i
Copy link

Eleg-i commented Dec 19, 2023

I need to specify the browser compatibility version when building the serviceWorker file.

Example

// vite-plugin-pwa/src/modules.ts line 112
await build({
  root: viteOptions.root,
  base: viteOptions.base,
  resolve: viteOptions.resolve,
  // don't copy anything from public folder
  publicDir: false,
  build: {
    sourcemap: viteOptions.build.sourcemap,
    lib: {
      entry: options.swSrc,
      name: 'app',
      formats: [format],
    },
    rollupOptions: {
      ...rollupOptions,
      plugins,
      output: {
        entryFileNames: options.filename,
      },
    },
    outDir: options.outDir,
    emptyOutDir: false
+   target: viteOptions.build.target
// or
+   target: options.target
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant