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: do not overwrite rollupOptions.input in dev #6025

Merged
merged 1 commit into from
Dec 13, 2021
Merged

fix: do not overwrite rollupOptions.input in dev #6025

merged 1 commit into from
Dec 13, 2021

Conversation

ydcjeff
Copy link
Contributor

@ydcjeff ydcjeff commented Dec 9, 2021

Description

fix #6020

rollupOptions.input should not be defined in dev mode unless explicitly added by users since Vite crawls *.html by default.

Additional context

Added dev.spec.ts to test dev command behavior since I can't find the respective file for the tests.


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 ydcjeff changed the title fix(build): only define rollupOptions.input in build, build & lib mode fix(buildOptions): only define rollupOptions.input in build, build & lib mode Dec 9, 2021
@Shinigami92 Shinigami92 added the p3-minor-bug An edge case that only affects very specific usage (priority) label Dec 9, 2021
Shinigami92
Shinigami92 previously approved these changes Dec 9, 2021
@patak-dev
Copy link
Member

So with this PR, the issue that @IanVS had in storybook vite builder wouldn't have happened? #5601 (comment). @IanVS maybe you could help to review this PR?

@IanVS
Copy link
Contributor

IanVS commented Dec 13, 2021

So with this PR, the issue that @IanVS had in storybook vite builder wouldn't have happened? #5601 (comment). @IanVS maybe you could help to review this PR?

No, my issue was happening in production builds, so I don't think this would have had an impact.

@patak-dev patak-dev changed the title fix(buildOptions): only define rollupOptions.input in build, build & lib mode fix: do not overwrite rollupOptions.input in dev Dec 13, 2021
@patak-dev patak-dev merged commit 6cdf13a into vitejs:main Dec 13, 2021
@ydcjeff ydcjeff deleted the fix/6020 branch December 14, 2021 02:15
@sibbng
Copy link
Contributor

sibbng commented Dec 18, 2021

@ydcjeff
Copy link
Contributor Author

ydcjeff commented Dec 18, 2021

@ydcjeff Tests are in https://github.com/vitejs/vite/blob/main/packages/vite/src/node/__tests__/build.spec.ts

Is that file for testing build mode? For this PR, it is for testing dev mode.

@sibbng
Copy link
Contributor

sibbng commented Dec 18, 2021

@ydcjeff Tests are in https://github.com/vitejs/vite/blob/main/packages/vite/src/node/__tests__/build.spec.ts

Is that file for testing build mode? For this PR, it is for testing dev mode.

It is for testing anything related to build functionality. Tests are not separated per command/mode, It's okay to put them there.

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.

build.lib.entry overwrote build.rollupOptions.input in dev mode
5 participants