Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
haoqunjiang merged 7 commits intovuejs:devfromAndreiSoroka:patch-1
Mar 22, 2022

Conversation

AndreiSoroka
Copy link
Contributor

@AndreiSorokaAndreiSoroka commentedFeb 21, 2022
edited
Loading

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

For module-federation need to use output auto

const{ defineConfig}=require('@vue/cli-service')constwebpack=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:[newwebpack.container.ModuleFederationPlugin({name:'vue_cli_demo',filename:'remoteEntry.js',exposes:{'./HelloWorld.vue':'./src/components/HelloWorld.vue',},shared:{vue:{singleton:true,},},}),],},transpileDependencies:true})

Fix problem for

after that I'll add example here

mityi, lBeJIuk, 209, artur-laptev, mdss-single, pparekh088, sambigelow, rodionbgd, jloa, and hang-up reacted with thumbs up emoji
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})
@AndreiSorokaAndreiSoroka changed the titleFix bug for configureWebpack.output = 'auto'Fix configureWebpack.output for Module-FederationFeb 21, 2022
@hansonfang
Copy link

https://next.cli.vuejs.org/config/#publicpath VueConfig has option for this.

@AndreiSoroka
Copy link
ContributorAuthor

AndreiSoroka commentedFeb 25, 2022
edited
Loading

@hansonfang
image
Local:http://localhost:8082/auto

But... I'm checking at the moment, seems MF is working...

Last time it confused me and I went looking for a workaround

@AndreiSoroka
Copy link
ContributorAuthor

@hansonfang updated MR

@AndreiSoroka
Copy link
ContributorAuthor

@hansonfang what do you think about current Mr? (after update)

@AndreiSoroka
Copy link
ContributorAuthor

FYI:@sodatea ?

@hansonfang
Copy link

@AndreiSoroka sorry I'm not member of contributor group. Maybe ask others to determine.

Copy link
Member

@haoqunjianghaoqunjiang left a 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.

@AndreiSoroka
Copy link
ContributorAuthor

thanks. I will update mr on this week

@AndreiSoroka
Copy link
ContributorAuthor

@sodatea Hi, can you re-review the code?

@haoqunjianghaoqunjiang changed the titleFix configureWebpack.output for Module-FederationBetter handling ofpublicPath: 'auto'Mar 22, 2022
@haoqunjianghaoqunjiang merged commitc5cfefb intovuejs:devMar 22, 2022
@AndreiSorokaAndreiSoroka deleted the patch-1 branchMarch 22, 2022 14:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@haoqunjianghaoqunjianghaoqunjiang approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@AndreiSoroka@hansonfang@haoqunjiang

[8]ページ先頭

©2009-2025 Movatter.jp