-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Better handling of publicPath: 'auto'
#7005
Conversation
For module-federation need to use output auto ```javascript const { 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 })
https://next.cli.vuejs.org/config/#publicpath VueConfig has option for this. |
@hansonfang But... I'm checking at the moment, seems MF is working... Last time it confused me and I went looking for a workaround |
This reverts commit 64933b2.
@hansonfang updated MR |
@hansonfang what do you think about current Mr? (after update) |
FYI: @sodatea ? |
@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 for publicPath: 'auto'
to work correctly.
For example, process.env.BASE_URL
should be set to ''
in this case. So does the baseUrl
argument for genHistoryApiFallbackRewrites
.
After applying those changes, I think it would be more consistent to replace the options.publicPath
here with process.env.BASE_URL
, too.
thanks. I will update mr on this week |
@sodatea Hi, can you re-review the code? |
publicPath: 'auto'
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