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

Remove duplicated publicPath #27

Merged
merged 3 commits into from
Sep 21, 2024

Conversation

karoldeland
Copy link
Contributor

When specifying a publicPath in webpack config, the standalone plugin add the publicPath to the main script path. The public path is already included in mainScript.attributes.src.

Maybe caused by a newer version of another package?

We had to patch locally the StandaloneSingleSpaPlugin with this change to not have /publicPath/publicPath/mainscript.js

@joeldenning
Copy link
Member

What version of webpack are you using? This plugin used to work with the latest version of webpack, so maybe the problem you're experiencing with v4 was caused by a change in webpack's behavior? If so, it should be documented in the Readme and possibly published as a new major version of standalone-single-spa-webpack-plugin.

@karoldeland
Copy link
Contributor Author

Hi @joeldenning , currently using WebPack 5
"webpack": "^5.90.3",

Not tested with previous versions of webpack, but pretty sure you're right.

@joeldenning
Copy link
Member

joeldenning commented Sep 21, 2024

I added a test that confirms the bug and the fix. The tests use webpack 5.75.0 and the bug was present in that version, so the problem wasn't caused by a change in webpack's behavior

@joeldenning
Copy link
Member

Removing the reference to publicPath in the modifyScripts function results in dead code within the apply function. This plugin currently supports multiple versions of html-webpack-plugin and I'm not sure if all versions would work with the updated changes here. Instead of testing each version, I'll just drop support for the older versions of html-webpack-plugin and publish this as a new major.

@joeldenning joeldenning merged commit 358f0d7 into single-spa:main Sep 21, 2024
@joeldenning
Copy link
Member

Published in 5.0.0. Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants