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

Migrate project from Webpack to Vite (Vue CLI EOM) #7468

Open
cnotv opened this issue Nov 16, 2022 · 2 comments
Open

Migrate project from Webpack to Vite (Vue CLI EOM) #7468

cnotv opened this issue Nov 16, 2022 · 2 comments
Assignees
Labels
area/ci CI and automation related, e.g. GitHub Actions area/upgrade kind/tech-debt Technical debt priority/2
Milestone

Comments

@cnotv
Copy link
Contributor

cnotv commented Nov 16, 2022

Description

After ditching Nuxt and upgrading to Vue3, migrate bundler to use Vite to reduce development time and improve DX.
Important: Vite is the default choice for the ecosystem, while the alternative and current tool is Vue CLI which is in maintenance mode.

Official Vue CLI to Vite migration article.

Context

Given the premises that Webpack module federation is not necessary (Vite alternative), but we rather rely on Yarn Workspaces, the migration to Vite seems now possible.

This will require to update all the configuration, which is usually generated by the Vue3 CLI in a prompt.
Build and CI pipelines will also require to be reviewed.

Complexities

Webpack NormalModuleReplacementPlugin

A particular attention will have to go to the Webpack configuration and the use of the NormalModuleReplacementPlugin() as it will have to be replaced by the Vite Plugin API (Thanks @catherineluse for the mention)

Webpack require.context()

In the project often, components are loaded globally or specifically in bulk. This has been already crossed as Webpack issue migrating from 4 to 5 (used by Vue3): #11773

Webpack VirtualModulesPlugin

TBD alternatives

Webpack BundleAnalyzerPlugin

TBD alternatives

CopyWebpackPlugin

TBD alternatives

Storybook

NOTE: Vue Webpack 5 is deprecated

Storybook can also be migrated to Vite and speed up a lot of development time, as explained in their article.
It should be possible to update it independently if imported as a library.

Development time will be way faster: Storybook run and up in 18s, with Vite it will be without waiting time.

Tests

This would also require a migration to Vitest since it embeds Jest and wires it nicely with Vite and avoid issues with ts-jest, vue-jest2|3 and surrounding.

@cnotv cnotv added kind/tech-debt Technical debt area/upgrade area/ci CI and automation related, e.g. GitHub Actions labels Nov 16, 2022
@cnotv cnotv self-assigned this Nov 16, 2022
@cnotv
Copy link
Contributor Author

cnotv commented Apr 19, 2023

Some notes from @rak-phillip about Vite integration while updating Vue to 2.7.
#8695

@cnotv cnotv added this to the v2.7.next4 milestone May 22, 2023
@nwmac nwmac modified the milestones: v2.8.0, v2.8.next1 Aug 15, 2023
@nwmac nwmac modified the milestones: v2.8.next1, v2.8.next2 Oct 23, 2023
@nwmac nwmac modified the milestones: v2.8.next2, v2.10.0 Feb 27, 2024
@cnotv
Copy link
Contributor Author

cnotv commented Mar 20, 2024

At the current time, further Webpack implementations have been added and the description requires to be updated.

@nwmac nwmac modified the milestones: v2.10.0, v2.11.0 Jul 4, 2024
@cnotv cnotv changed the title Migrate project from Webpack to Vite Migrate project from Webpack to Vite (Vue CLI EOM) Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci CI and automation related, e.g. GitHub Actions area/upgrade kind/tech-debt Technical debt priority/2
Projects
None yet
Development

No branches or pull requests

4 participants