fix: 에러 없이 emit 된 경우에만 빌드 완료 표지 출력

This commit is contained in:
2021-12-12 15:28:52 +09:00
parent fd057ebb05
commit 0b82024caa
+15 -4
View File
@@ -30,13 +30,19 @@ module.exports = (env, argv) => {
const genBuildHook = function (oTarget) {
const checkFilePath = resolve(outputPath, `build_${oTarget}.txt`);
return function (percentage, msg) {
let emitDone = false;
let writeDone = false;
return function (percentage, msg, ...args) {
if(msg == 'emitting'){
emitDone = true;
}
if (percentage == 0) {
if (fs.existsSync(checkFilePath)) {
fs.unlinkSync(checkFilePath);
}
} else if (percentage == 1) {
} else if (percentage == 1 && emitDone && !writeDone) {
fs.writeFileSync(checkFilePath, new Date().toISOString(), 'utf-8');
writeDone = true;
}
};
};
@@ -177,7 +183,11 @@ module.exports = (env, argv) => {
new CleanTerminalPlugin(),
new VueLoaderPlugin(),
new MiniCssExtractPlugin(),
new webpack.ProgressPlugin(genBuildHook('vue')),
new webpack.ProgressPlugin({
percentBy: 'modules',
dependencies: false,
handler: genBuildHook('vue')
}),
//new BundleAnalyzerPlugin()
],
cache: {
@@ -388,7 +398,8 @@ module.exports = (env, argv) => {
};
if(env.WEBPACK_WATCH || !versionValue){
return [gateway, ingame_vue, ingame];
return [ingame_vue];
//return [gateway, ingame_vue, ingame];
}
const buildConfList = [];