Skip to content

Commit 64933b2

Browse files
authored
Fix bug for configureWebpack.output = 'auto'
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 })
1 parent f7dc46d commit 64933b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@vue/cli-service/lib/util/validateWebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function validateWebpackConfig (
2828
)
2929
}
3030

31-
if (target === 'app' && singleConfig.output.publicPath !== options.publicPath) {
31+
if (target === 'app' && ![options.publicPath, 'auto'].includes(singleConfig.output.publicPath)) {
3232
throw new Error(
3333
`\n\nConfiguration Error: ` +
3434
`Avoid modifying webpack output.publicPath directly. ` +

0 commit comments

Comments
 (0)