vanilla-cli no longer builds vanilla/vanilla
With https://github.com/vanilla/vanilla/pull/7612 the vanilla-cli tool is no longer the build tool for core. The build tool now lives directly in the vanilla/vanilla repo.
New Features
- Hot reloading. Updates to react components no longer require a full rebuild.
- Build all addons at once. Both the dev and production builds build all enabled addons at the same time.
- Tied to vanilla so it can't differ for what a particular vanilla version requires.
Migrating
- Stop using the
vanillacommand for building. - Run
yarn installin the top level of you vanilla repo. I would recommend adding git hooks according to this doc so that your composer and node modules automatically update when you pull. - Use the following equivalent commands instead
vanilla build
Use yarn build in the root of your vanilla installation.
vanilla build --hot
Use yarn build:dev in the root of your vanilla installation.
Auto-formatting changes
Previously running a build would automatically try to fix your source files. This is still available but has put behind a flag due to IDE conflict issues noticed by myself and @Todd.
To restore the auto-formatting/fixing behaviour add --fix or -f to the end of your build command. This also works with the hot build.
yarn build --fix # or yarn build -f
Auto node_module installation
Previously the build tool would automatically install the node_modules of the addons being built. Due to the time this can add to startup it has also been moved behind a flag. To automatically install all addon's node_modules before building pass the --install or -i flag at the end of one of the build commands.
Example
To combine both of the above to replicate the way a hot build worked previously (with auto-install and format) you would do the following:
yarn build:dev --fix --install # or yarn build:dev -fi