feat: migrate build tooling from 10up-toolkit to Vite+ (POC) - #333
Draft
fabiankaegy wants to merge 2 commits into
Draft
feat: migrate build tooling from 10up-toolkit to Vite+ (POC)#333fabiankaegy wants to merge 2 commits into
fabiankaegy wants to merge 2 commits into
Conversation
Replaces webpack-based 10up-toolkit with the Vite+ toolchain (vp) and @10up/wp-vite-plugins across the monorepo: - build: vp build (Vite 8 / Rolldown) with a dual script + Script Module pass; block entries discovered from block.json, per-core-block styles emitted to dist/autoenqueue/, .asset.php sidecars via wpExternals - lint/format: vp check (oxfmt + oxlint); CSS stays on stylelint with @10up/stylelint-config; block-theme HTML/JSON excluded from oxfmt to preserve Gutenberg serializer output - typecheck: tsgo --noEmit (tsconfig moduleResolution updated to Bundler) - test: vp test (Vitest) with --passWithNoTests - tasks: root scripts fan out via vp run -r with caching enabled - pre-commit: husky now runs vp staged (config in root vite.config.ts), replacing lint-staged/.lintstagedrc.json and .eslintrc files - @wordpress/* packages are now installed per workspace; externalization is driven by their own wpScript/wpScriptModuleExports metadata - @10up/wp-vite-plugins consumed from packages/ tarball until published Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@10up/wp-vite-plugins now always includes wpCleanCssChunks (a no-op without CSS-only entries), so the mu-plugin config no longer needs to add it manually. Refreshes the packaged tarball. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
@fabiankaegy PRs created #335 and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A proof-of-concept migration of the wp-scaffold monorepo's build tooling from 10up-toolkit (webpack) to the Vite+ toolchain (
vp) + the new@10up/wp-vite-pluginspackage.Opening as a draft for others to easily test — it is not ready to merge. The plugin package is not published to npm yet, so it's consumed here as a committed tarball (see below).
What changed
Both themes (
tenup-theme,tenup-block-theme) and the mu-plugin now build through Vite+ instead of 10up-toolkit:vp build(Vite 8 / Rolldown) with a dual script + Script Module pass. Block entries are discovered fromblock.json, per-core-block styles are emitted todist/autoenqueue/, and.asset.phpdependency sidecars are produced bywpExternals. Each workspace has its ownvite.config.ts.vp check(oxfmt + oxlint). CSS stays on stylelint (@10up/stylelint-config); block-theme HTML/JSON are excluded from oxfmt so Gutenberg serializer output isn't reformatted.tsgo --noEmit(tsconfigmoduleResolution→Bundler).vp test(Vitest).vp run -r(with caching where safe).vp staged(configured in the rootvite.config.ts), replacinglint-staged/.lintstagedrc.json/.eslintrc.@wordpress/*packages are installed per workspace; externalization is driven by each package's ownwpScript/wpScriptModuleExportsmetadata rather than a hardcoded list.10up-toolkit,npm-run-all,lint-staged, rootprettier; addsvite-plus,@10up/stylelint-config, stylelint + postcss plugins.@10up/wp-vite-pluginsitself bundles the WordPress-specific Vite plugins (wpBlocks,wpBlockStyles,wpCopyAssets,wpExternals,wpScriptIife,wpCleanCssChunks) behind a singlewp()composer — see the package README.How to test
Then spin up the site and confirm blocks, editor scripts, frontend assets, and per-block styles enqueue correctly.
Note on the package dependency
@10up/wp-vite-pluginsis not yet on npm, so it's vendored as a tarball atpackages/10up-wp-vite-plugins-0.1.0-beta.0.tgzand referenced viafile:from each workspace. The tarball in this PR is built from the current plugin source. Once the package is published, thefile:references should be swapped for the npm version.Status / open questions
@10up/wp-vite-pluginsto npm vs. keeping the vendored tarball🤖 Generated with Claude Code