mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-25 15:59:16 +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 { join } from 'path';
|
||||
import { existsSync, writeFileSync } from 'fs';
|
||||
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 {
|
||||
[k: string]: DependencyObj;
|
||||
@ -115,6 +115,8 @@ export function genStyleDepsMap() {
|
||||
);
|
||||
});
|
||||
|
||||
ensureDirSync(DIST_DIR);
|
||||
|
||||
writeFileSync(
|
||||
STYPE_DEPS_JSON_FILE,
|
||||
JSON.stringify({ map, sequence }, null, 2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user