@lexho111/plainblog 0.5.12 → 0.5.13
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/build-styles.js +18 -3
- package/package.json +3 -13
package/build-styles.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import postcss from "postcss";
|
|
3
|
-
import autoprefixer from "autoprefixer";
|
|
4
|
-
import cssnano from "cssnano";
|
|
5
2
|
|
|
6
3
|
/**
|
|
7
4
|
* Compiles CSS styles from file content objects.
|
|
@@ -39,6 +36,24 @@ export async function compileStyles(fileData) {
|
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
async function postcss2(css) {
|
|
39
|
+
let postcss, autoprefixer, cssnano;
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
postcss = (await import("postcss")).default;
|
|
43
|
+
autoprefixer = (await import("autoprefixer")).default;
|
|
44
|
+
cssnano = (await import("cssnano")).default;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error(
|
|
47
|
+
"\n\x1b[31m%s\x1b[0m",
|
|
48
|
+
"ERROR: Missing CSS processing dependencies."
|
|
49
|
+
);
|
|
50
|
+
console.error(
|
|
51
|
+
"To use this feature, please install the following packages manually:"
|
|
52
|
+
);
|
|
53
|
+
console.error("\n npm install postcss autoprefixer cssnano\n");
|
|
54
|
+
throw new Error("Missing optional dependencies");
|
|
55
|
+
}
|
|
56
|
+
|
|
42
57
|
const plugins = [autoprefixer(), cssnano()];
|
|
43
58
|
const result = await postcss(plugins).process(css, {
|
|
44
59
|
from: undefined, // do not print source map warning
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lexho111/plainblog",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "A tool for creating and serving a minimalist, single-page blog.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "node index.js",
|
|
9
9
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
10
|
-
"lint": "eslint ."
|
|
11
|
-
"knip": "knip"
|
|
10
|
+
"lint": "eslint ."
|
|
12
11
|
},
|
|
13
12
|
"keywords": [
|
|
14
13
|
"blog",
|
|
@@ -18,10 +17,7 @@
|
|
|
18
17
|
"author": "lexho111",
|
|
19
18
|
"license": "ISC",
|
|
20
19
|
"dependencies": {
|
|
21
|
-
"
|
|
22
|
-
"cssnano": "^7.1.2",
|
|
23
|
-
"node-fetch": "^3.3.2",
|
|
24
|
-
"postcss": "^8.5.6"
|
|
20
|
+
"node-fetch": "^3.3.2"
|
|
25
21
|
},
|
|
26
22
|
"devDependencies": {
|
|
27
23
|
"@eslint/js": "^9.39.2",
|
|
@@ -31,11 +27,5 @@
|
|
|
31
27
|
"globals": "^17.0.0",
|
|
32
28
|
"jest": "^29.7.0",
|
|
33
29
|
"typescript": "^5.9.3"
|
|
34
|
-
},
|
|
35
|
-
"optionalDependencies": {
|
|
36
|
-
"sqlite3": "^5.1.7",
|
|
37
|
-
"pg": "^8.16.3",
|
|
38
|
-
"pg-hstore": "^2.3.4",
|
|
39
|
-
"sequelize": "^6.37.7"
|
|
40
30
|
}
|
|
41
31
|
}
|