]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
fix script for eslint
authorMark Otto <markdotto@gmail.com>
Wed, 7 Jan 2026 00:00:03 +0000 (16:00 -0800)
committerMark Otto <markdotto@gmail.com>
Fri, 9 Jan 2026 04:14:09 +0000 (20:14 -0800)
build/css-minify.mjs

index f811c6cb8418a9b7f30280131113f8f7719a6704..317f9f1425d1c2cb41ea68820b025247717ef2c0 100644 (file)
@@ -23,14 +23,14 @@ const targets = browserslistToTargets(['> 0.5%', 'last 2 versions', 'Firefox ESR
 for (const file of cssFiles) {
   const inputPath = path.join(distDir, file)
   const outputPath = path.join(distDir, file.replace('.css', '.min.css'))
-  const mapPath = outputPath + '.map'
+  const mapPath = `${outputPath}.map`
 
   console.log(`Minifying ${file}...`)
 
   const inputCss = fs.readFileSync(inputPath, 'utf8')
-  const inputMap = fs.existsSync(inputPath + '.map')
-    ? JSON.parse(fs.readFileSync(inputPath + '.map', 'utf8'))
-    undefined
+  const inputMap = fs.existsSync(`${inputPath}.map`) ?
+    JSON.parse(fs.readFileSync(`${inputPath}.map`, 'utf8')) :
+    undefined
 
   try {
     const result = transform({
@@ -43,7 +43,7 @@ for (const file of cssFiles) {
     })
 
     // Write minified CSS with source map reference
-    const minifiedCss = result.code.toString() + `\n/*# sourceMappingURL=${path.basename(mapPath)} */`
+    const minifiedCss = `${result.code.toString()}\n/*# sourceMappingURL=${path.basename(mapPath)} */`
     fs.writeFileSync(outputPath, minifiedCss)
 
     // Write source map