question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

plugin-legacy: polyfills chunk should respect output.entryFileNames option

See original GitHub issue

Clear and concise description of the problem

As a developer I want to disable hashing of filenames, so I can always reference the same polyfill file.

Suggested solution

I would be nice if the plugin-legacy would follow the build.rollupOptions.output.entryFileNames option. In my case, I would like to add <script nomodule src="dist/assets/polyfills-legacy.js"></script> to my HTML.

I guess it would involve adding entryFileNames: buildOptions.rollupOptions.output.entryFileNames, to the output config of buildPolyfillChunk().

Alternative

No response

Additional context

No response

Validations

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

2reactions
freesou2commented, Dec 6, 2021

same issue for me

0reactions
jheng-jiecommented, Apr 21, 2022

temporary plan

  • node_modules/@vitejs/plugin-legacy/index.js

  • find async function buildPolyfillChunk

const res = await build({
  build: {
    rollupOptions: {
      output: {
        entryFileNames: "[name].js",
      }
    }
  }
})

waiting for repair!

Read more comments on GitHub >

github_iconTop Results From Across the Web

vitejs/plugin-legacy
Enabling this option will generate a separate polyfills chunk for the modern build (targeting browsers with native ESM support).
Read more >
Building for production
This page focuses on recommendations for building an application that uses Lit components for production. For recommendations on build steps to perform on ......
Read more >
packages/vite/CHANGELOG.md · Gitee 极速下载/ViteJS
modulePreload.polyfill . ... fix(plugin-legacy): respect entryFileNames for polyfill chunks (#8247) (baa9632), closes #8247; fix(plugin-react): broken ...
Read more >
vite build
To support legacy browsers, Vite offers @vite_js/plugin-legacy. ... These output chunks need to be hashed to enable strong caching.
Read more >
Building for Production | Vite (main branch)
Legacy browsers can be supported via @vitejs/plugin-legacy, which will automatically generate legacy chunks and corresponding ES language feature polyfills.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found