mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-26 00:09:15 +08:00
fix(cli): should ensure dir before output file
This commit is contained in:
parent
8bcfc13ce2
commit
9318e6b909
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
import dependencyTree from 'dependency-tree';
|
import dependencyTree from 'dependency-tree';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { existsSync, writeFileSync } from 'fs';
|
|
||||||
import { getComponents } from '../common';
|
import { getComponents } from '../common';
|
||||||
import { ES_DIR, STYPE_DEPS_JSON_FILE } from '../common/constant';
|
import { existsSync, writeFileSync, ensureDirSync } from 'fs-extra';
|
||||||
|
import { ES_DIR, DIST_DIR, STYPE_DEPS_JSON_FILE } from '../common/constant';
|
||||||
|
|
||||||
interface DependencyObj {
|
interface DependencyObj {
|
||||||
[k: string]: DependencyObj;
|
[k: string]: DependencyObj;
|
||||||
@ -115,6 +115,8 @@ export function genStyleDepsMap() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ensureDirSync(DIST_DIR);
|
||||||
|
|
||||||
writeFileSync(
|
writeFileSync(
|
||||||
STYPE_DEPS_JSON_FILE,
|
STYPE_DEPS_JSON_FILE,
|
||||||
JSON.stringify({ map, sequence }, null, 2)
|
JSON.stringify({ map, sequence }, null, 2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user