Skip to content

Commit 90ae774

Browse files
georginahalpernGeorgina
andauthored
Add check for build errors before running CopyMinToMax Webpack plugin (#17002)
Previously if UMD failed the webpackPlugin would still try to copy minified.js file over (which wouldnt exist) so it would error out and that error would appear in build, hiding the actual underlying error. This change skips the webpackPlugin copy if there is a build error, and logs to console to notify. Co-authored-by: Georgina <[email protected]>
1 parent a5896a7 commit 90ae774

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/dev/buildTools/src/webpackTools.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ export const commonDevWebpackConfiguration = (
251251
class CopyMinToMaxWebpackPlugin {
252252
apply(compiler: Compiler) {
253253
compiler.hooks.done.tap("CopyToMax", (stats) => {
254+
if (stats.hasErrors()) {
255+
console.error("Build had errors, skipping CopyMinToMax plugin");
256+
return;
257+
}
254258
const outputPath = stats.compilation.outputOptions.path;
255259
if (outputPath) {
256260
for (const chunk of stats.compilation.chunks) {

0 commit comments

Comments
 (0)