From 7b7ec8d5c85513a5891f126b2f5bceb086eb86ff Mon Sep 17 00:00:00 2001 From: wukang0718 <42261663+wukang0718@users.noreply.github.com> Date: Tue, 6 Apr 2021 11:41:25 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20gen-type=20el-locale=20?= =?UTF-8?q?to=20locale=20(#1720)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gen-type el-locale to locale Co-authored-by: wukang --- build/gen-type.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/gen-type.js b/build/gen-type.js index b353e615dc..7f9db50762 100644 --- a/build/gen-type.js +++ b/build/gen-type.js @@ -14,7 +14,7 @@ fs.copyFileSync( const newIndexPath = path.resolve(__dirname, '../lib/index.d.ts') fs.copyFileSync(path.resolve(__dirname, '../lib/element-plus/index.d.ts'), newIndexPath) const index = fs.readFileSync(newIndexPath) -const newIndex = index.toString().replace(/@element-plus\//g, './el-').replace('el-utils', 'utils') +const newIndex = index.toString().replace(/@element-plus\//g, './el-').replace('el-utils', 'utils').replace('el-locale', 'locale') fs.writeFileSync(newIndexPath, newIndex) // remove ep @@ -37,7 +37,7 @@ fs.readdirSync(libDirPath).forEach(comp => { if(outsideImport.test(imp) || imp.includes('@element-plus/')) { const newImp = imp.replace(outsideImport, (i, c) => { return i.replace(`../${c}`, `../el-${c}`) - }).replace('@element-plus/', '../el-').replace('el-utils', 'utils') + }).replace('@element-plus/', '../el-').replace('el-utils', 'utils').replace('el-locale', 'locale') fs.writeFileSync(path.resolve(__dirname, '../lib', newCompName, 'index.d.ts'), newImp) } } @@ -57,7 +57,7 @@ fs.readdirSync(libDirPath).forEach(comp => { if (!fs.lstatSync(path.resolve(srcPath, f)).isDirectory()) { const imp = fs.readFileSync(path.resolve(srcPath, f)).toString() if (imp.includes('@element-plus/')) { - const newImp = imp.replace(/@element-plus\//g, '../../el-') + const newImp = imp.replace(/@element-plus\//g, '../../el-').replace('el-utils', 'utils').replace('el-locale', 'locale') fs.writeFileSync(path.resolve(srcPath, f), newImp) } }