mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-11-30 18:27:40 +08:00
chore: 🤖 gen-type el-locale to locale (#1720)
gen-type el-locale to locale Co-authored-by: wukang <wukang@yuzhilin.net.cn>
This commit is contained in:
parent
87a16f24d3
commit
7b7ec8d5c8
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user