diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-05-30 17:34:50 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-05-30 17:34:50 +0300 |
| commit | b76af33e9bfb57b46fb8d8292b614bf9ee2e3c2d (patch) | |
| tree | e0ea787595d4a518351e7b9e897893913f09b2cf /build.js | |
| parent | 705b89e85c404ab9f9e62a7746d13ff5073a6edf (diff) | |
| download | the-epube-b76af33e9bfb57b46fb8d8292b614bf9ee2e3c2d.tar.gz the-epube-b76af33e9bfb57b46fb8d8292b614bf9ee2e3c2d.tar.xz | |
drop postcss - slow
Diffstat (limited to 'build.js')
| -rw-r--r-- | build.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/build.js b/build.js index ed91103..8a7285e 100644 --- a/build.js +++ b/build.js @@ -4,10 +4,8 @@ import * as esbuild from 'esbuild'; import { readFileSync } from 'fs'; import { writeFile } from 'fs/promises'; import less from 'less'; -import cssnano from 'cssnano'; import chokidar from 'chokidar'; import path from 'path'; -import postcss from 'postcss'; const LIB_FILES = [ 'lib/bootstrap/v3/js/jquery.js', @@ -116,14 +114,13 @@ async function buildCSSfile(file) { const source = readFileSync(file, 'utf-8'); + const outputFile = "dist/" + path.basename(file.replace(/\.less$/, '.min.css')); const lessResult = await less.render(source, { - paths: [path.dirname(file)] + paths: [path.dirname(file)], + compress: true }); - const outputFile = "dist/" + path.basename(file.replace(/\.less$/, '.min.css')); - const minified = await postcss([cssnano]).process(lessResult.css, { from: outputFile }); - - await writeFile(outputFile, minified.css); + await writeFile(outputFile, lessResult.css); } catch (e) { console.warn(`css build failed for ${file}: `, e.message || e); |
