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

[@vite/legacy] No worker file generate when using legacy to run vite build. #19132

Open
7 tasks done
Flcwl opened this issue Jan 4, 2025 · 0 comments
Open
7 tasks done

Comments

@Flcwl
Copy link

Flcwl commented Jan 4, 2025

Describe the bug

I want to use the worker in old browser by @vite/legacy. But has no worker file generate when running vite build it.
image

import vue from '@vitejs/plugin-vue';
import legacy from '@vitejs/plugin-legacy';
import { resolve } from 'path';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    vue(),
    legacy({
      renderModernChunks: false,
      renderLegacyChunks: true,
    }),
  ],
  build: {
    reportCompressedSize: false,
  },
  worker: {
    format: 'iife',
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, './src'),
    },
  },
});

Reproduction

https://stackblitz.com/edit/node-la3to4sk?file=vite.config.ts

Steps to reproduce

Run npm install followed by npm run build

System Info

"devDependencies": {
    "@vitejs/plugin-legacy": "^6.0.0",
    "@vitejs/plugin-vue": "^5.2.1",
    "typescript": "^5.7.2",
    "vite": "^6.0.7"
  },

Used Package Manager

npm

Logs

No response

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant