This is the minimally invasive change to fix resolution of the default minifierPath: 'metro-minify-terser', especially under isolated node_modules layouts.
minifierPath is required/resolved only from metro-transform-worker:
Per the current docs for minifierPath, a module specifier relative to metro-transform-worker is explicitly acceptable:
Type: string (default: 'metro-minify-terser')
Path, or package name resolvable from metro-transform-worker, to the minifier that minifies the code after transformation.
Unlike https://github.com/facebook/metro/pull/1172 (thanks tido64 for flagging), this doesn't modify the defaults and can be released in a patch release. The approach in that PR (using fully resolved paths in config) may be the better long-term fix though, so this patch shouldn't be regarded as superseding it.
Changelog:
- **[Fix]:** Move `metro-minify-terser` dependency to fix resolution under isolated node_modules (pnpm, etc).
Summary: Related: https://github.com/facebook/metro/pull/1172
This is the minimally invasive change to fix resolution of the default
minifierPath: 'metro-minify-terser'
, especially under isolated node_modules layouts.minifierPath
is required/resolved only frommetro-transform-worker
:Per the current docs for
minifierPath
, a module specifier relative tometro-transform-worker
is explicitly acceptable:Unlike https://github.com/facebook/metro/pull/1172 (thanks tido64 for flagging), this doesn't modify the defaults and can be released in a patch release. The approach in that PR (using fully resolved paths in config) may be the better long-term fix though, so this patch shouldn't be regarded as superseding it.
Changelog:
Differential Revision: D53000650