Skip to content

2.0.0 Release#151

Merged
g-elwell merged 88 commits intomainfrom
release/2.0.0
Oct 16, 2025
Merged

2.0.0 Release#151
g-elwell merged 88 commits intomainfrom
release/2.0.0

Conversation

@g-elwell
Copy link
Member

@g-elwell g-elwell commented Oct 14, 2025

This PR updates the build tools to 2.0.0.

Fixes #106
Fixes #109
Fixes #139

This has been tested extensively on projects via alpha release tags, and is ready to become the default version. Within this PR I've updated the documentation to include an upgrade guide which outlines the main changes and issues a person may experience when upgrading an existing project from v1 to v2, copied below:

Upgrading from Build Tools v1

Handling lint differences

There are several new lint rules in place that weren't present in v1 of the build-tools, and some of these can generate a lot of noise. However many are also automatically fixable. If you're upgrading an existing project, presuming you have set up prettier and eslint to use our config, you can run npx eslint ./src --fix to detect and fix all auto-fixable issues.

build directory is now dist

This aligns with wp-scripts naming conventions and ensures that wp-scripts works as expected. For example, certain actions will auto-ignore files in the dist directory.

asset-settings.php is no longer used

v1 of the build tools generated a file at inc/asset-settings.php. This is no longer created, so any references to this file in your project should be removed. This file is usually not tracked in VCS, but if it is, or if it exists for you locally, you should remove it.

SVG import syntax has changed

If you're using SVG files in JavaScript, the syntax to import assets has changed to match wp-scripts. There are two ways to import an SVG:

  • As a React Component: import { ReactComponent as IconComponent } from './icon.svg';
  • As a URL: import iconURL from './icon.svg';

Static directory is no longer copied to dist

We previously used a src/static directory to copy files from src to build. This is no longer required.

Fonts and images imported into JavaScript files will be transformed and moved to build regardless of where they are located. Any other files that you want to have available should reside in a static directory which is not inside of the src directory, and not processed at all by the tooling.

Block registration

Block registration has been simplified due to the use of wp-scripts. Block source code should reside in src/blocks/{block-name} and include a block.json file which references assets by file path. JavaScript, (S)CSS and even PHP should be located in the block directory, and the tooling will handle processing of all files into dist/blocks/{block-name}.

You can review the WordPress docs for more information on how block.json and assets work.

ampersarnie and others added 30 commits August 13, 2024 16:05
Change webpack config to use @wordpress/scripts.
the entrypoint detection should not care if block entrypoints are present, as these are handled by wp-scripts. it can continue to throw an error provided we catch this in the correct location
Ensure block and non-block entrypoints can be built together
Remove css-loader and mini-css-extract-plugin packages
g-elwell and others added 26 commits May 6, 2025 09:12
fix: adds context path assignment to webpack configs
* fix: remove custom image rules

* test: update svg import syntax in example site

* chore: version bump
* fix: ensure script module config uses correct source path for project

* chore: version bump
@g-elwell g-elwell marked this pull request as ready for review October 14, 2025 11:53
@g-elwell g-elwell requested a review from ampersarnie as a code owner October 14, 2025 11:53
Copy link
Member

@ampersarnie ampersarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big moment! 🙌

@g-elwell g-elwell merged commit 0580875 into main Oct 16, 2025
3 checks passed
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.

[Tracking Issue]: v2.0.0 Release Update minimum Node version to v22 [Bug]: eslint config is incorrect

2 participants