Skip to content
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

feat(ssr): vue-ssr-webpack-plugin compatible with webpack 5 #12002

Merged
merged 2 commits into from Jun 2, 2021

Conversation

gzzhanghao
Copy link
Contributor

@gzzhanghao gzzhanghao commented Apr 3, 2021

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

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

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

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Similar to #11863, but:

  • Fix modules mapping in client plugin
  • Ignore hmr assets
  • Fix the deprecation warning

Fix #11718
Close #11863

@posva posva changed the title feat(ssr): vue-ssr-webpack-plugin compatible with webpack 5, fix #11718 feat(ssr): vue-ssr-webpack-plugin compatible with webpack 5 Apr 7, 2021
@redneckz
Copy link

Hi colleagues.
Have a nice day.

The last activity was several weeks ago...
Any progress on this issue?

Currently, we try to move to Webpack 5 and have troubles with Vue SSR plugin.
We stuck trying to migrate to micro frontend architecture (by means of Module Federation). In our case, it is a blocker :(

Please give some roadmap to adjust our deadlines and make appropriate decisions.

Thanks in advance.

@gzzhanghao
Copy link
Contributor Author

@redneckz It's not a good practice, but you can copy server-plugin.js and client-plugin.js to your project and use it locally.

https://github.com/gzzhanghao/vue/tree/ssr-webpack-5-build/packages/vue-server-renderer

@@ -31,5 +31,8 @@
"devDependencies": {
"vue": "file:../.."
},
"peerDependencies": {
"webpack": "*"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an optional peer dependency.
Users should be able to use this package without webpack.

@@ -10,7 +10,8 @@ export default class VueSSRServerPlugin {
apply (compiler) {
validate(compiler)

onEmit(compiler, 'vue-server-plugin', (compilation, cb) => {
const stage = 'PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just put the stage name in the onEmit function? It's not used anywhere else

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sodatea client plugin and server plugin are applied in different stage, so I think it's better to specify the stage name here.

@gzzhanghao gzzhanghao requested a review from sodatea May 2, 2021 04:11
@posva posva merged commit 80e7730 into vuejs:dev Jun 2, 2021
@posva posva added this to Planned in 2.6.15 via automation Jun 2, 2021
@posva posva moved this from Planned to Done in 2.6.15 Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

vuejs/vue-ssr-webpack-plugin and webpack 5
4 participants