From: Evan You Date: Mon, 6 Feb 2023 01:47:46 +0000 (+0800) Subject: build: fix const enum when cache dir does not exist X-Git-Tag: v3.3.0-alpha.3~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d4883ca77eec3dc5259f4b28e2d8099a5467555;p=thirdparty%2Fvuejs%2Fcore.git build: fix const enum when cache dir does not exist --- diff --git a/scripts/const-enum.js b/scripts/const-enum.js index b4a602af68..5063f8b943 100644 --- a/scripts/const-enum.js +++ b/scripts/const-enum.js @@ -17,9 +17,9 @@ import execa from 'execa' import { existsSync, + mkdirSync, readFileSync, rmSync, - writeFile, writeFileSync } from 'node:fs' import { parse } from '@babel/parser' @@ -164,6 +164,7 @@ export function scanEnums() { } // 3. save cache + if (!existsSync('temp')) mkdirSync('temp') writeFileSync(ENUM_CACHE_PATH, JSON.stringify(enumData)) return () => {