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

fix(plugin-legacy): respect entryFileNames for polyfill chunks #8247

Merged
merged 1 commit into from May 20, 2022

Conversation

sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented May 20, 2022

Potentially breaking change: vite/legacy-polyfills in manifest is now vite/legacy-polyfills-legacy. polyfills-modern.hash.js is now polyfills.hash.js.

Description

legacy and modern polyfill chunk file names now respect entryFileNames.
As a byproduct, conflicted entry in manifest was solved. I will describe this in the additional context.

I tested with pnpm build:custom-filename in playground/legacy.

close #4221
refs #8180

Additional context

When modernPolyfill is enabled, vite/legacy-polyfills in manifest.json points to modern polyfill chunk. Also there was no entry pointing to legacy polyfill chunk.
When it is disabled, it points to legacy polyfill chunk.

It was like this.

  "vite/legacy-polyfills": {
    "file": "assets/polyfills-modern.792b0ede.js",
    "src": "vite/legacy-polyfills",
    "isEntry": true
  },

This PR changes it to

  "vite/legacy-polyfills-legacy": {
    "file": "assets/polyfills-legacy.378fc635.js",
    "src": "vite/legacy-polyfills-legacy",
    "isEntry": true
  },
  "vite/legacy-polyfills": {
    "file": "assets/polyfills.4dce788d.js",
    "src": "vite/legacy-polyfills",
    "isEntry": true
  }

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

(maybe it's a feat than a fix?)

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Potentially breaking change: `vite/legacy-polyfills` in manifest is now `vite/legacy-polyfills-legacy`, `polyfills-modern.hash.js` is now `polyfills.hash.js`.
@sapphi-red sapphi-red added plugin: legacy p3-minor-bug An edge case that only affects very specific usage (priority) labels May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) plugin: legacy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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