storyblok / field-plugin

Create and deploy Storyblok Field Plugin
https://www.storyblok.com/docs/plugins/field-plugins/introduction
25 stars 3 forks source link

chore(common): clean up dev vite configs #304

Closed eunjae-lee closed 9 months ago

eunjae-lee commented 10 months ago

What?

In #264, we added dev-template.mjs script to create a dev version of vite configs for all templates which include aliases to the field plugin library.

It helped us develop templates without having to re-build the library when we need to update both the template and the library at the same time.

However this applied to only dev command to the templates. Thinking of test command, this needed some change. Now once you run yarn install, the postinstall command will automatically generate the dev version of vite configs. And dev:xxx and test:xxx commands will use these configs.

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plugin-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2023 3:24pm
eunjae-lee commented 9 months ago

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

BibiSebi commented 9 months ago

Just for me to double-check, so now in case you run yarn install in the root, this will prepare everything. If you make a change afterward inside the field plugin, the templates will still be able to pick up the change.

eunjae-lee commented 9 months ago

Just for me to double-check, so now in case you run yarn install in the root, this will prepare everything. If you make a change afterward inside the field plugin, the templates will still be able to pick up the change.

yes! that postinstall generates the dev vite configs right automatically after yarn install. And then if you run yarn dev:xxx at the root level, it uses the dev config instead of the real one in the template. So it picks up the change from the library directly without having to bundle the library 👍🏼