Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork6.3k
Better handling ofpublicPath: 'auto'
#7005
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
For module-federation need to use output auto```javascriptconst { defineConfig } = require('@vue/cli-service')const webpack = require('webpack')module.exports = defineConfig({ configureWebpack: { output: { publicPath: 'auto', // <- ERROR: Avoid modifying webpack output.publicPath directly. Use the "publicPath" option instead. }, optimization: { splitChunks: false, }, plugins: [ new webpack.container.ModuleFederationPlugin({ name: 'vue_cli_demo', filename: 'remoteEntry.js', exposes: { './HelloWorld.vue': './src/components/HelloWorld.vue', }, shared: { vue: { singleton: true, }, }, }), ], }, transpileDependencies: true})
hansonfang commentedFeb 25, 2022
https://next.cli.vuejs.org/config/#publicpath VueConfig has option for this. |
AndreiSoroka commentedFeb 25, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@hansonfang But... I'm checking at the moment, seems MF is working... Last time it confused me and I went looking for a workaround |
@hansonfang updated MR |
@hansonfang what do you think about current Mr? (after update) |
FYI:@sodatea ? |
hansonfang commentedMar 2, 2022
@AndreiSoroka sorry I'm not member of contributor group. Maybe ask others to determine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the PR.
But I think there are still many places that we need to fix forpublicPath: 'auto'
to work correctly.
For example,process.env.BASE_URL
should be set to''
in this case. So does thebaseUrl
argument forgenHistoryApiFallbackRewrites
.
After applying those changes, I think it would be more consistent to replace theoptions.publicPath
here withprocess.env.BASE_URL
, too.
thanks. I will update mr on this week |
@sodatea Hi, can you re-review the code? |
publicPath: 'auto'
Uh oh!
There was an error while loading.Please reload this page.
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
Other information:
For module-federation need to use output auto
Fix problem for
after that I'll add example here