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

Improved next/asset support #3664

Merged
merged 2 commits into from
Feb 2, 2018
Merged

Improved next/asset support #3664

merged 2 commits into from
Feb 2, 2018

Conversation

arunoda
Copy link
Contributor

@arunoda arunoda commented Feb 2, 2018

This PR improves the behaviour of next/asset

  • It'll support dynamic assetPrefixes
  • It ignores prefixing for URLs starts with http(s)://

Also added test cases for above scenarios.

// With this, static assets will work across zones
// With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
// So, this is how we do it in the client side at runtime
__webpack_public_path__ = `${assetPrefix}/_next/webpack/` //eslint-disable-line
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@timneutkens have a look at this.
This is a public API: https://webpack.js.org/guides/public-path/#on-the-fly

Copy link
Member

Choose a reason for hiding this comment

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

🕵️

Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

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

👍

@timneutkens timneutkens merged commit 60cb06c into canary Feb 2, 2018
@timneutkens timneutkens deleted the improved-next-asset branch February 2, 2018 20:10
@lock lock bot locked as resolved and limited conversation to collaborators Feb 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants