forgecss 0.8.0 → 0.10.0
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/cli.js +7 -5
- package/dist/forgecss.min.js +16 -16
- package/package.json +1 -1
- package/standalone/forgecss.js +16 -3
- package/standalone/lib/inventory.js +6 -9
- package/standalone/lib/usages.js +5 -11
package/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import chokidar from "chokidar";
|
|
|
8
8
|
|
|
9
9
|
import ForgeCSS from './index.js';
|
|
10
10
|
|
|
11
|
-
program.option("-c, --config <string>,", "Path to forgecss config file", process.cwd() + "/forgecss.config.
|
|
11
|
+
program.option("-c, --config <string>,", "Path to forgecss config file", process.cwd() + "/forgecss.config.json");
|
|
12
12
|
program.option("-w, --watch", "Enable watch mode", false);
|
|
13
13
|
program.option("-v, --verbose", "Enable watch mode", false);
|
|
14
14
|
program.parse();
|
|
@@ -22,10 +22,12 @@ if (!fs.existsSync(options.config)) {
|
|
|
22
22
|
|
|
23
23
|
async function loadConfig(configPath) {
|
|
24
24
|
const abs = path.resolve(configPath);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const jsonStr = fs.readFileSync(abs, "utf-8");
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(jsonStr);
|
|
28
|
+
} catch(err) {
|
|
29
|
+
throw new Error(`forgecss: error parsing config file at ${configPath}: ${err}`);
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
async function runForgeCSS(lookAtPath = null) {
|
|
31
33
|
if (!config) {
|