Chore: Avoid copying package.json into dist folder (#80278)

This commit is contained in:
Andres Martinez Gotor
2024-01-10 16:38:36 +01:00
committed by GitHub
parent ee7daeb2a7
commit 42f1059bc9

View File

@@ -17,6 +17,10 @@ function skipFiles(f: string): boolean {
// avoid copying tsconfig.json
return false;
}
if (f.includes('/package.json')) {
// avoid copying package.json
return false;
}
return true;
}
@@ -179,18 +183,6 @@ const config = async (env: Record<string, unknown>): Promise<Configuration> => {
},
],
},
{
dir: path.resolve(DIST_DIR),
files: ['package.json'],
rules: [
{
search: `"version": "${getPackageJson().version}"`,
replace: env.commit
? `"version": "${getPackageJson().version}-${env.commit}"`
: `"version": "${getPackageJson().version}"`,
},
],
},
]),
env.development
? new ForkTsCheckerWebpackPlugin({