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

Legacy plugin does not respect assetsDir setting #1530

Closed
2 of 3 tasks
sqal opened this issue Jan 14, 2021 · 0 comments · Fixed by #1532
Closed
2 of 3 tasks

Legacy plugin does not respect assetsDir setting #1530

sqal opened this issue Jan 14, 2021 · 0 comments · Fixed by #1532

Comments

@sqal
Copy link

sqal commented Jan 14, 2021

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

@vitejs/plugin-legacy doesn't respect custom assetsDir setting. In my case, I would like to use 'static' dir, but the plugin emits polyfills-legacy.js chunk in the default 'assets' directory.

Reproduction

import legacy from '@vitejs/plugin-legacy'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    legacy({
      targets: ['defaults', 'not IE 11']
    })
  ],
  build: {
    assetsDir: 'static'
  }
})

System Info

  • vite version: vite@2.0.0-beta.27 / @vitejs/plugin-react-refresh@1.2.0
  • Operating System: Windows 10
  • Node version: v14.14.0
  • Package manager (npm/yarn/pnpm) and version: yarn

Logs (Optional if provided reproduction)

C:\Users\pc\dev\vite-playground>yarn build
building for production...
dist/static/index-legacy.9a045c13.js       0.12kb / brotli: 0.08kb
dist/assets/polyfills-legacy.6a501a48.js   36.51kb / brotli: 12.49kb
dist/static/index.f86dd5ee.js    0.65kb / brotli: 0.32kb
dist/static/index.4bc2bdd2.css   0.29kb / brotli: 0.19kb
dist/index.html                  0.93kb
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant