esm-styles 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/build.js +8 -2
- package/package.json +2 -3
package/dist/lib/build.js
CHANGED
|
@@ -6,7 +6,7 @@ import path from 'node:path';
|
|
|
6
6
|
import fs from 'node:fs/promises';
|
|
7
7
|
// import { inspect } from 'node:util'
|
|
8
8
|
import _ from 'lodash';
|
|
9
|
-
import
|
|
9
|
+
import * as esbuild from 'esbuild';
|
|
10
10
|
export async function build(configPath = 'esm-styles.config.js') {
|
|
11
11
|
// --- Supporting module generation ---
|
|
12
12
|
// Debug: log mergedSets and sets
|
|
@@ -204,7 +204,13 @@ export async function build(configPath = 'esm-styles.config.js') {
|
|
|
204
204
|
}
|
|
205
205
|
// if floor should be minified, minify wrappedCss string
|
|
206
206
|
if (minify) {
|
|
207
|
-
|
|
207
|
+
const result = await esbuild.transform(wrappedCss, {
|
|
208
|
+
loader: 'css',
|
|
209
|
+
minifyWhitespace: true,
|
|
210
|
+
minifyIdentifiers: true,
|
|
211
|
+
minifySyntax: false,
|
|
212
|
+
});
|
|
213
|
+
wrappedCss = result.code;
|
|
208
214
|
}
|
|
209
215
|
await fs.writeFile(outputFile, wrappedCss, 'utf8');
|
|
210
216
|
// Calculate relative path from default output directory for imports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esm-styles",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "A library for working with ESM styles",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"watch": "dist/watch.js"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/clean-css": "^4.2.11",
|
|
39
38
|
"@types/jest": "^29.5.14",
|
|
40
39
|
"@types/js-beautify": "^1.14.3",
|
|
41
40
|
"@types/lodash": "^4.17.16",
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"typescript": "^5.8.3"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|
|
53
|
-
"
|
|
52
|
+
"esbuild": "^0.27.2",
|
|
54
53
|
"js-beautify": "^1.15.4"
|
|
55
54
|
},
|
|
56
55
|
"repository": {
|