esbuild-css-modules-plugin
Advanced tools
Comparing version 2.0.1 to 2.0.2
12
index.js
@@ -84,3 +84,3 @@ const path = require('path'); | ||
setup(build) { | ||
const tmpCsses = []; | ||
const tmpCsses = new Set(); | ||
const rootDir = process.cwd(); | ||
@@ -114,3 +114,3 @@ const tmpDirPath = tmp.dirSync().name; | ||
await writeFile(tmpCss, cssContent); | ||
tmpCsses.push(tmpCss); | ||
tmpCsses.add(tmpCss); | ||
jsContent = | ||
@@ -192,4 +192,8 @@ `import "${tmpCss}"; | ||
build.onEnd(() => { | ||
console.log('Clean temp files...') | ||
tmpCsses.forEach(f => fs.unlinkSync(f)); | ||
console.log('[esbuild-css-modules-plugin] Clean temp files...'); | ||
tmpCsses.forEach((f) => { | ||
try { | ||
fs.unlinkSync(f); | ||
} catch (error) {} | ||
}); | ||
}); | ||
@@ -196,0 +200,0 @@ } |
{ | ||
"name": "esbuild-css-modules-plugin", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -44,3 +44,3 @@ # esbuild-css-modules-plugin | ||
v2: true // recommend. v2 can bundle images in css, note if set `v2` to true, the `inject` option will be ignored. and v2 only works with `bundle: true`. | ||
v2: true // experimental. v2 can bundle images in css, note if set `v2` to true, the `inject` option will be ignored. and v2 only works with `bundle: true`. | ||
}) | ||
@@ -47,0 +47,0 @@ ] |
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
19510
247