fix: remove first umijs in prod html

This commit is contained in:
jialin
2024-07-23 13:38:02 +08:00
parent 9c9b35ff9b
commit 50104cf276
8 changed files with 9 additions and 45 deletions
-3
View File
@@ -19,9 +19,6 @@ export default defineConfig({
history: {
type: 'hash'
},
// https: {
// http2: true
// },
base: process.env.npm_config_base || '/',
...(isProduction
? {
-38
View File
@@ -1,38 +0,0 @@
// @ts-nocheck
const fs = require('fs');
const path = require('path');
class DeleteCssPlugin {
constructor(options) {
this.options = options || {};
}
apply(compiler) {
compiler.hooks.done.tap('DeleteCssPlugin', (stats) => {
const outputPath =
this.options.outputPath || path.resolve(__dirname, 'dist');
fs.readdir(outputPath, (err, files) => {
if (err) {
console.error(`Failed to read directory: ${outputPath}`, err);
return;
}
files.forEach((file) => {
if (file.endsWith('.css')) {
const filePath = path.join(outputPath, file);
fs.unlink(filePath, (err) => {
if (err) {
console.error(`Failed to delete file: ${filePath}`, err);
} else {
console.log(`Deleted: ${filePath}`);
}
});
}
});
});
});
}
}
module.exports = DeleteCssPlugin;