esbuild-css-modules-plugin
Advanced tools
Comparing version 2.0.0 to 2.0.1
14
index.js
@@ -84,2 +84,3 @@ const path = require('path'); | ||
setup(build) { | ||
const tmpCsses = []; | ||
const rootDir = process.cwd(); | ||
@@ -113,2 +114,3 @@ const tmpDirPath = tmp.dirSync().name; | ||
await writeFile(tmpCss, cssContent); | ||
tmpCsses.push(tmpCss); | ||
jsContent = | ||
@@ -181,9 +183,2 @@ `import "${tmpCss}"; | ||
); | ||
if (tmpCss) { | ||
setTimeout(() => { | ||
try { | ||
fs.unlinkSync(tmpCss); | ||
} catch (e) {} | ||
}, 1000); | ||
} | ||
return { | ||
@@ -196,2 +191,7 @@ contents: args.pluginData.content, | ||
}); | ||
build.onEnd(() => { | ||
console.log('Clean temp files...') | ||
tmpCsses.forEach(f => fs.unlinkSync(f)); | ||
}); | ||
} | ||
@@ -198,0 +198,0 @@ }; |
{ | ||
"name": "esbuild-css-modules-plugin", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19399
243