🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

webpack-plugin-deletecompilerbundle

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-plugin-deletecompilerbundle - npm Package Compare versions

Comparing version
1.2.0
to
1.2.1
+22
-18
lib/index.ts

@@ -37,24 +37,28 @@ import * as path from 'path';

// 判断是不是文件夹
const fileStats = fs.statSync(folderPath);
try {
const fileStats = fs.statSync(folderPath);
// 文件夹删除
if (fileStats.isDirectory()) {
if (fs.existsSync(folderPath)) {
try {
fs.rmSync(folderPath, { recursive: true, force: true });
// 文件夹删除
if (fileStats.isDirectory()) {
if (fs.existsSync(folderPath)) {
try {
fs.rmSync(folderPath, { recursive: true, force: true });
console.log(`\x1b[42;30m 删除文件夹成功: ${folderPath} \x1b[0m`);
} catch (error) {
console.log(`\x1b[41;30m 删除文件夹失败 ----> ${folderPath} \x1b[0m`);
console.log(`\x1b[42;30m 删除文件夹成功: ${folderPath} \x1b[0m`);
} catch (error) {
console.log(`\x1b[41;30m 删除文件夹失败 ----> ${folderPath} \x1b[0m`);
}
}
} else {
// 文件删除
const sourcePath = path.join(stats.compilation.compiler.outputPath, itemFolder);
try {
fs.unlinkSync(sourcePath);
console.log(`\x1b[42;30m 删除文件夹成功: ${sourcePath} \x1b[0m`);
} catch {
console.log(`\x1b[41;30m 删除文件失败 ----> ${sourcePath} \x1b[0m`);
}
}
} else {
// 文件删除
const sourcePath = path.join(stats.compilation.compiler.outputPath, itemFolder);
try {
fs.unlinkSync(sourcePath);
console.log(`\x1b[42;30m 删除文件夹成功: ${sourcePath} \x1b[0m`);
} catch {
console.log(`\x1b[41;30m 删除文件失败 ----> ${sourcePath} \x1b[0m`);
}
} catch {
console.log(`\x1b[41;30m 执行异常 \x1b[0m`);
}

@@ -61,0 +65,0 @@ }

{
"name": "webpack-plugin-deletecompilerbundle",
"version": "1.2.0",
"version": "1.2.1",
"description": "webpack plugin delete compiler bundle",

@@ -5,0 +5,0 @@ "author": "gzh <18255106634@163.com>",