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: normalize #build windows path for dev and prerender presets #70

Merged
merged 3 commits into from
Apr 11, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves nuxt/framework#4232

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The fix applied to dev preset also needs to be applied to prerender preset. It seemed easiest way was to extract from options and add to preset itself. There may be a better way to do this.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added the bug Something isn't working label Apr 11, 2022
@danielroe danielroe requested a review from pi0 April 11, 2022 10:16
@danielroe danielroe self-assigned this Apr 11, 2022
'nitro:rollup:before' (nitro) {
if (isWindows) {
// Windows dynamic imports should be file:// url
nitro.options.alias['#build'] = pathToFileURL(nitro.options.buildDir).href
Copy link
Member

Choose a reason for hiding this comment

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

Shared situation with both is externals: { trace: false }

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm. Perhaps we could just test for that instead in rollup config, or are you happy with the preset option?

Copy link
Member

Choose a reason for hiding this comment

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

Improved in 1ec2ee4. Extending alias was too late here.

src/presets/nitro-prerender.ts Outdated Show resolved Hide resolved
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

LGTM. Seems a more clear workaround at least.

@pi0 pi0 changed the title fix: set file url for prerender preset fix: normalize #build windows path for dev and prerender presets Apr 11, 2022
src/presets/nitro-prerender.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants