1 Star 0 Fork 0

gao / lowCodeComponentPlugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build-remove.js 768 Bytes
一键复制 编辑 原始数据 按行查看 历史
gao 提交于 2024-03-06 18:18 . 完整打包脚手架代码上传
/**
* 删除打包目录结构下多余的js文件
*/
const fs = require('fs');
const path = require('path');
const directoryPath = 'dist'; // 目标目录路径
// 读取目录下的所有文件
fs.readdir(directoryPath, (err, files) => {
if (err) {
console.error('Error reading directory:', err);
return;
}
// 筛选出需要删除的文件
const filesToDelete = files.filter(file => file.endsWith('.js') || file.endsWith('.js.map'));
// 删除文件
filesToDelete.forEach(file => {
const filePath = path.join(directoryPath, file);
fs.unlink(filePath, err => {
if (err) {
console.error(`Error deleting file ${file}:`, err);
} else {
console.log(`${file} deleted successfully`);
}
});
});
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gao1998/low-code-component-plugin.git
git@gitee.com:gao1998/low-code-component-plugin.git
gao1998
low-code-component-plugin
lowCodeComponentPlugin
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891