Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7f5748

Browse files
committed
remove unused empty css files
1 parent d71b621 commit e7f5748

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tasks/util/bundle_wrapper.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import fs from 'fs';
12
import fsExtra from 'fs-extra';
23
import prependFile from 'prepend-file';
34

@@ -43,7 +44,17 @@ export default async function _bundle(pathToIndex, pathToBundle, opts, cb) {
4344

4445
await build(config);
4546

46-
addWrapper(pathToBundle)
47+
addWrapper(pathToBundle);
48+
49+
if(pathToBundle.endsWith('.js')) {
50+
var len = pathToBundle.length;
51+
var cssOutput = pathToBundle.slice(0, len - 3) + '.css';
52+
53+
// remove unwanted css file
54+
if (fs.existsSync(cssOutput)) {
55+
fs.unlinkSync(cssOutput);
56+
}
57+
}
4758

4859
if(cb) cb();
4960
}

0 commit comments

Comments
 (0)