The default implementation of the sanitizePackageJson
option. Strips development-only fields from the bundled app's package.json:
devDependencies, scripts, workspace and package manager settings (workspaces,
packageManager, resolutions, overrides, pnpm), publishing settings (private,
publishConfig, devEngines), and common tooling configuration (jest, eslintConfig,
prettier, browserslist, lint-staged, nano-staged, husky, commitlint, mocha,
ava, nyc, c8, tap, xo, standard).
All other fields are kept, notably runtime-relevant ones such as main, name,
productName, version, type, imports, exports, dependencies,
optionalDependencies, and peerDependencies.
Custom sanitizePackageJson arrays can include this function to extend the default
behavior rather than replace it.
The default implementation of the sanitizePackageJson option. Strips development-only fields from the bundled app's
package.json:devDependencies,scripts, workspace and package manager settings (workspaces,packageManager,resolutions,overrides,pnpm), publishing settings (private,publishConfig,devEngines), and common tooling configuration (jest,eslintConfig,prettier,browserslist,lint-staged,nano-staged,husky,commitlint,mocha,ava,nyc,c8,tap,xo,standard).All other fields are kept, notably runtime-relevant ones such as
main,name,productName,version,type,imports,exports,dependencies,optionalDependencies, andpeerDependencies.Custom
sanitizePackageJsonarrays can include this function to extend the default behavior rather than replace it.