Skip to content

Commit 4564123

Browse files
committed
Framework: Drop the NODE_PATH fallback in create-block validation
The fallback worked around `@wordpress/scripts` resolving its default browserslist config from the consumer's cwd, which #83902 fixes in the package itself by passing the preset's queries to webpack.
1 parent dc63a44 commit 4564123

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

‎tools/validation/test-create-block.mjs‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,6 @@ function run( command, args, options = {} ) {
6060
}
6161
}
6262

63-
/*
64-
* Under an isolated install layout, transitive deps are not hoisted to the root `node_modules/`.
65-
* `@wordpress/scripts` shells out to webpack, eslint, etc. via `resolve-bin`,
66-
* which calls `require.resolve` from its own location in the dep store and
67-
* therefore can't see those sibling packages. Adding `packages/scripts/`'s
68-
* own `node_modules/` as a `NODE_PATH` fallback lets Node find them.
69-
*/
70-
const NODE_PATH = [
71-
path.join( ROOT, 'packages/scripts/node_modules' ),
72-
process.env.NODE_PATH,
73-
]
74-
.filter( Boolean )
75-
.join( path.delimiter );
76-
7763
/**
7864
* Resolve a bin via module resolution rather than a `node_modules/.bin` path,
7965
* whose location depends on the install layout.
@@ -113,10 +99,7 @@ function wpCreateBlock( args, options = {} ) {
11399
* @param {...string} args Command arguments forwarded to `wp-scripts`.
114100
*/
115101
function wpScripts( ...args ) {
116-
run( process.execPath, [ WP_SCRIPTS, ...args ], {
117-
cwd: STATIC_BLOCK,
118-
env: { ...process.env, NODE_PATH },
119-
} );
102+
run( process.execPath, [ WP_SCRIPTS, ...args ], { cwd: STATIC_BLOCK } );
120103
}
121104

122105
/**

0 commit comments

Comments
 (0)