Skip to content

Commit 44ef0da

Browse files
committed
fix script for eslint
1 parent adb3383 commit 44ef0da

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

build/css-minify.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ const targets = browserslistToTargets(['> 0.5%', 'last 2 versions', 'Firefox ESR
2323
for (const file of cssFiles) {
2424
const inputPath = path.join(distDir, file)
2525
const outputPath = path.join(distDir, file.replace('.css', '.min.css'))
26-
const mapPath = outputPath + '.map'
26+
const mapPath = `${outputPath}.map`
2727

2828
console.log(`Minifying ${file}...`)
2929

3030
const inputCss = fs.readFileSync(inputPath, 'utf8')
31-
const inputMap = fs.existsSync(inputPath + '.map')
32-
? JSON.parse(fs.readFileSync(inputPath + '.map', 'utf8'))
33-
: undefined
31+
const inputMap = fs.existsSync(`${inputPath}.map`) ?
32+
JSON.parse(fs.readFileSync(`${inputPath}.map`, 'utf8')) :
33+
undefined
3434

3535
try {
3636
const result = transform({
@@ -43,7 +43,7 @@ for (const file of cssFiles) {
4343
})
4444

4545
// Write minified CSS with source map reference
46-
const minifiedCss = result.code.toString() + `\n/*# sourceMappingURL=${path.basename(mapPath)} */`
46+
const minifiedCss = `${result.code.toString()}\n/*# sourceMappingURL=${path.basename(mapPath)} */`
4747
fs.writeFileSync(outputPath, minifiedCss)
4848

4949
// Write source map

0 commit comments

Comments
 (0)