Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Add support for plugin-specific public path #81

Merged
merged 3 commits into from Dec 18, 2019

Conversation

jimmydief
Copy link
Contributor

Override the public path from which files generated by this plugin will be served. This wins out over Webpack's dynamic runtime path and can be useful to avoid attempting to load workers cross-origin when using a CDN for other static resources.

Not sure what the testing strategy here should be.

Fixes #80.

Override the public path from which files generated by this plugin will be served. This wins out over Webpack's dynamic runtime path and can be useful to avoid attempting to load workers cross-origin when using a CDN for other static resources.
@msftclas
Copy link

msftclas commented Nov 15, 2019

CLA assistant check
All CLA requirements met.

// 2. Dynamic runtime public path.
// 3. Compilation public path.
const pathPrefix = Boolean(pluginPublicPath)
? JSON.stringify(pluginPublicPath)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Plugin public path wins out over dynamic public path if specified.

const pathPrefix = Boolean(pluginPublicPath)
? JSON.stringify(pluginPublicPath)
: `typeof __webpack_public_path__ === 'string' ` +
`? __webpack_public_path__ ` +
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Including the fix from #63 here since I'm touching the same code – this should be referenced as a free variable and not off of window as documented here.

@alexdima
Copy link
Member

Thank you! ❤️

@alexdima alexdima merged commit dfa3f22 into microsoft:master Dec 18, 2019
@alexdima alexdima added this to the December 2019 milestone Dec 18, 2019
@jimmydief jimmydief deleted the plugin_public_path branch January 29, 2020 08:26
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.

Allow specifying public path for worker files
3 participants