Skip to content

fix(html): import expression in classic script for dev#14595

Merged
patak-cat merged 1 commit intovitejs:mainfrom
sapphi-red:fix/html-import-expression-in-classic-script-for-dev
Oct 12, 2023
Merged

fix(html): import expression in classic script for dev#14595
patak-cat merged 1 commit intovitejs:mainfrom
sapphi-red:fix/html-import-expression-in-classic-script-for-dev

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Oct 12, 2023

Description

This PR includes changes from #14592 (otherwise, the tests fail)

Support for import expressions in classic script (added by #6525) was not working for dev.
This PR fixes that.

This bug was found at #5657 (comment).

Additional context


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 PR Title 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.

@sapphi-red sapphi-red added feat: html p3-minor-bug An edge case that only affects very specific usage (priority) labels Oct 12, 2023
Comment on lines -242 to +245
// use resolved port/base from server
const devBase = server.config.base
viteTestUrl = `http://localhost:${server.config.server.port}${
devBase === '/' ? '' : devBase
}`
viteTestUrl = server.resolvedUrls.local[0]
if (server.config.base === '/') {
viteTestUrl = viteTestUrl.replace(/\/$/, '')
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assets playground has base: '/foo/bar' but playwright was accessing http://localhost:5173/foo/bar/ instead of http://localhost:5173/foo/bar.

patak-cat
patak-cat previously approved these changes Oct 12, 2023
@sapphi-red sapphi-red dismissed patak-cat’s stale review October 12, 2023 09:55

The merge-base changed after approval.

@sapphi-red sapphi-red force-pushed the fix/html-import-expression-in-classic-script-for-dev branch from db2d7f2 to f1e5d17 Compare October 12, 2023 09:55
@sapphi-red
Copy link
Member Author

Rebased on main to resolve conflict with #14592.

@patak-cat patak-cat merged commit ea47b8f into vitejs:main Oct 12, 2023
@sapphi-red sapphi-red deleted the fix/html-import-expression-in-classic-script-for-dev branch October 12, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: html 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.

2 participants