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(html): import expression in classic script for dev #14595

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-dev
patak-dev previously approved these changes Oct 12, 2023
@sapphi-red sapphi-red dismissed patak-dev’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-dev patak-dev merged commit ea47b8f into vitejs:main Oct 12, 2023
11 checks passed
@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