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(ssr): dont replace rollup input #7275

Merged
merged 1 commit into from
Jun 13, 2022
Merged

Conversation

manucorporat
Copy link
Contributor

Description

Setting custom input in rollupConfig always replaces, even the ssr entry points.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

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.

@ydcjeff
Copy link
Contributor

ydcjeff commented Mar 11, 2022

Can you describe more about why this change is required?

@manucorporat
Copy link
Contributor Author

Basically, the --ssr my.ssr.entry.tsx is not used at all if a rollupConfig input is specified.

export default defineConfig(({ mode }) => {
  return {
    build: {
      rollupOptions: {
        input: ['src/main.tsx', 'index.html'],

Notice that we already generate the final input, using rollupConfig when necessarily...
https://github.com/vitejs/vite/pull/7275/files#diff-aa53520bfd53e6c24220c44494457cc66370fd2bee513c15f9be7eb537a363e7R381-R385

But this value is override and never used because this line:
https://github.com/vitejs/vite/pull/7275/files#diff-aa53520bfd53e6c24220c44494457cc66370fd2bee513c15f9be7eb537a363e7R432

replaces it.

@ydcjeff
Copy link
Contributor

ydcjeff commented Mar 11, 2022

I see. For your example, which input do you expect to pass to the rollup since it now has ssr entry and rollupOptions.input?

@manucorporat
Copy link
Contributor Author

I would expect to use the one I passed in --ssr

@manucorporat
Copy link
Contributor Author

Any updates?

@patak-dev
Copy link
Member

Sorry @manucorporat, I missed this one til now

@patak-dev patak-dev merged commit 9a88afa into vitejs:main Jun 13, 2022
@patak-dev patak-dev added the p3-minor-bug An edge case that only affects very specific usage (priority) label Jun 13, 2022
@SteveDesmond-ca
Copy link

Per #9086, it seems this may have gone a little too broad. Any thoughts on how to rein it back in a bit? Or is my use case now officially unsupported?

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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants