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 to Vite for asset bundling #167

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

vivgui
Copy link

@vivgui vivgui commented Jul 17, 2022

The project currently uses webpack for assets bundling but there's an interest in switching to Vite. This PR attempts to do that migration. I first tested this on the foundation theme (you can see my repo fork here) and things worked correctly.

One major thing that the migration to Vite changed is that Vite doesn't use .browserslistrc for setting browser compatibility, it uses esbuild instead so the .config/.browserslistrc file is not needed.

Besides that, I tried my best to replace all the webpack-specific functionality using Vite plugins and configurations.

I know this is a significant change and I'm open to discussing how to best approach it. I just wanted to demonstrate that migrating to Vite is possible and worthwhile.

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

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • 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:

  • It's submitted to the dev branch, not the main branch

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:

@montalvomiguelo
Copy link

Hey guys, at barrel created a Vite/Shopify plugin that I think you will love (:

vite-plugin-shopify.mp4

@vivgui
Copy link
Author

vivgui commented Jul 19, 2022

@montalvomiguelo what's the github repo? would like to take a look

@vivgui
Copy link
Author

vivgui commented Aug 31, 2022

I wanted to follow up on this, is there anything you want me to change/talk about before this can be approved?

@adotrevino
Copy link

when is this going to be approved?

@curiouscrusher
Copy link

+1 would love to see this implemented!

@Chadyka
Copy link

Chadyka commented Nov 12, 2022

+1 this is just what I'm missing from the current implementation

@pablogiralt
Copy link

+1

1 similar comment
@james0r
Copy link

james0r commented Jan 25, 2023

+1

@james0r
Copy link

james0r commented Jan 26, 2023

Adapted OP's Vite implementation for use with Alpine.js if anyone wants to check it out here. Havn't got it working with Shopify CLI v3 yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants