10000 Better handling of `publicPath: 'auto'` by AndreiSoroka · Pull Request #7005 · vuejs/vue-cli · GitHub
[go: up one dir, main page]

Skip to content

Better handling of publicPath: '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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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
})
  • Loading branch information
AndreiSoroka authored Feb 21, 2022
commit 64933b262d72ec97b750c4309d78cbaa9e7e0f42
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = function validateWebpackConfig (
)
}

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