Skip to content

Commit

Permalink
Update rollup plugin node-resolve, fix potential infinite loop in fin…
Browse files Browse the repository at this point in the history
…dPackageJson (#70)
  • Loading branch information
dumganhar authored Nov 4, 2024
1 parent b62659b commit 9cb4097
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 58 deletions.
8 changes: 5 additions & 3 deletions .api/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14878,7 +14878,7 @@ declare module "@cocos/ccbuild" {
/**
* Locate modules using the Node resolution algorithm, for using third party modules in node_modules
*/
export function nodeResolve(options?: __private.___node_modules_rollup_plugin_node_resolve_types_index__RollupNodeResolveOptions): Plugin;
export function nodeResolve(options?: __private.___node_modules_cocos_rollup_plugin_node_resolve_types_index__RollupNodeResolveOptions): Plugin;
/**
* Convert CommonJS modules to ES6, so they can be included in a Rollup bundle
*/
Expand Down Expand Up @@ -16397,7 +16397,7 @@ declare module "@cocos/ccbuild" {
*/
namedExports?: boolean;
}
export interface ___node_modules_rollup_plugin_node_resolve_types_index__RollupNodeResolveOptions {
export interface ___node_modules_cocos_rollup_plugin_node_resolve_types_index__RollupNodeResolveOptions {
/**
* Additional conditions of the package.json exports field to match when resolving modules.
* By default, this plugin looks for the `'default', 'module', 'import']` conditions when resolving imports.
Expand Down Expand Up @@ -16460,9 +16460,11 @@ declare module "@cocos/ccbuild" {
/**
* If `true`, the plugin will prefer built-in modules (e.g. `fs`, `path`). If `false`,
* the plugin will look for locally installed modules of the same name.
*
* If a function is provided, it will be called to determine whether to prefer built-ins.
* @default true
*/
preferBuiltins?: boolean;
preferBuiltins?: boolean | ((module: string) => boolean);
/**
* An `Array` which instructs the plugin to limit module resolution to those whose
* names match patterns in the array.
Expand Down
2 changes: 1 addition & 1 deletion modules/bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@cocos/rollup-plugin-node-resolve": "^15.3.0",
"@rollup/plugin-virtual": "^3.0.2",
"@rollup/plugin-typescript": "~11.1.6",
"@rollup/plugin-terser": "^0.4.4",
Expand Down
2 changes: 1 addition & 1 deletion modules/bundler/src/rollup/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import * as babel from '@rollup/plugin-babel';
import json from '@rollup/plugin-json';
import nodeResolve from '@rollup/plugin-node-resolve';
import nodeResolve from '@cocos/rollup-plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import virtual from '@rollup/plugin-virtual';
import terser from '@rollup/plugin-terser';
Expand Down
78 changes: 26 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cocos/ccbuild",
"version": "2.2.16",
"version": "2.2.17",
"description": "The next generation of build tool for Cocos engine.",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down

0 comments on commit 9cb4097

Please sign in to comment.