esbuild-css-modules-plugin
Advanced tools
Comparing version 2.0.4 to 2.0.5
11
index.js
@@ -115,9 +115,9 @@ const path = require('path'); | ||
if (useV2) { | ||
build.onLoad({ filter: /\.modules?\.css$/, namespace: 'file' }, async (args) => { | ||
build.onLoad({ filter: /\.modules?\.css$/ }, async (args) => { | ||
const fullPath = args.path; | ||
outputLogs && console.log(`[css-modules-plugin] ${fullPath}`); | ||
const tmpDir = tmp.dirSync().name; | ||
const tmpCssFile = path.join( | ||
tmp.dirSync().name, | ||
fullPath.replace(/\.modules?\.css$/, '.modules_built.css') | ||
tmpDir, | ||
fullPath.replace(rootDir, '').replace(/\.modules?\.css$/, '.modules_built.css') | ||
); | ||
@@ -133,3 +133,4 @@ fse.ensureDirSync(path.dirname(tmpCssFile)); | ||
fs.writeFileSync(tmpCssFile, `${finalCss}`, { encoding: 'utf-8' }); | ||
outputLogs && console.log(`[css-modules-plugin] build css file`, tmpCssFile); | ||
outputLogs && | ||
console.log(`[css-modules-plugin] build css file`, tmpCssFile.replace(tmpDir, '')); | ||
@@ -136,0 +137,0 @@ const jsFileContent = `import "${tmpCssFile}";${jsContent}`; |
{ | ||
"name": "esbuild-css-modules-plugin", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"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
285
21299