Skip to content

Commit 5ff9470

Browse files
feat. disable minification on debug builds
1 parent 5b54276 commit 5ff9470

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

src/fileSystem/internalFs.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,27 @@ const internalFs = {
116116
return new Promise((resolve, reject) => {
117117
console.log("Deleting " + filename);
118118

119-
Filesystem.stat({ path: filename })
120-
.then((stats) => {
121-
if (stats.type === "directory") {
122-
return Filesystem.rmdir({ path: filename, recursive: true });
123-
} else {
124-
return Filesystem.deleteFile({ path: filename });
125-
}
126-
})
127-
.then(() => {
128-
console.log("Deleted successfully!");
129-
resolve();
130-
})
131-
.catch((error) => {
132-
console.error("Error while deleting:", error);
133-
reject(error);
134-
});
119+
if (!this.exists(filename)) {
120+
console.log(`File ${filename} doesnt exists`);
121+
resolve();
122+
} else {
123+
Filesystem.stat({ path: filename })
124+
.then((stats) => {
125+
if (stats.type === "directory") {
126+
return Filesystem.rmdir({ path: filename, recursive: true });
127+
} else {
128+
return Filesystem.deleteFile({ path: filename });
129+
}
130+
})
131+
.then(() => {
132+
console.log("Deleted successfully!");
133+
resolve();
134+
})
135+
.catch((error) => {
136+
console.error("Error while deleting:", error);
137+
reject(error);
138+
});
139+
}
135140
});
136141
},
137142

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ module.exports = (env, options) => {
8585
filename: '../../css/build/[name].css',
8686
}),
8787
],
88+
optimization: {
89+
minimize: mode === 'production',
90+
// Only set a custom minimizer in production; otherwise, omit it.
91+
...(mode === 'production' ? {} : { minimizer: [] }),
92+
},
93+
8894
};
8995

9096
return [main];

0 commit comments

Comments
 (0)