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 build ignores custom filenames #2356

Closed
pedrodim opened this issue Mar 3, 2021 · 2 comments · Fixed by #2641
Closed

Legacy build ignores custom filenames #2356

pedrodim opened this issue Mar 3, 2021 · 2 comments · Fixed by #2641
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) plugin: legacy

Comments

@pedrodim
Copy link
Contributor

pedrodim commented Mar 3, 2021

Describe the bug

When using custom output's filenames the legacy build ignores the format and keeps its own format.

Screenshot 2021-03-03 at 10 21 29

The formats are hardcoded on legacy plugin: [name]-legacy.[hash].js and [name]-legacy.[hash].js.

Reproduction

import legacy from '@vitejs/plugin-legacy'

export default defineConfig({
  plugins: [legacy()],
  build: {
    rollupOptions: {
      output: {
        entryFileNames: `[name].js`,
        chunkFileNames: `[name].js`,
        assetFileNames: `[name].[ext]`
      }
    }
  }
})

System Info

  • vite version: 2.0.4
  • Operating System: macOS Big Sur
  • Node version: 12.21.0
  • Package manager (npm/yarn/pnpm) and version: npm 6.14.11
@Shinigami92 Shinigami92 added p3-minor-bug An edge case that only affects very specific usage (priority) bug labels Mar 22, 2021
patak-dev pushed a commit that referenced this issue May 21, 2021
Co-authored-by: Shinigami <chrissi92@hotmail.de>
fi3ework pushed a commit to fi3ework/vite that referenced this issue May 22, 2021
@wxxcarl
Copy link

wxxcarl commented Jun 2, 2021

but when i config output.chunkFileNames width a function, it throw an error:

@vitejs/plugin-legacy rollupOptions.output.entryFileNames and rollupOptions.output.chunkFileNames does not support the function format.

For some reason,i must custom chunkFileNames, how can i do

@github-actions
Copy link

This issue has been locked since it has been closed for more than 14 days.

If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) plugin: legacy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants