Skip to content

Commit

Permalink
fix: fix copy-style-files.ts
Browse files Browse the repository at this point in the history
修复当项目全路径含src时,编译产生的样式文件的路径不符合预期的问题

fix formilyjs#7
  • Loading branch information
wanghongcheng0302 committed Feb 9, 2023
1 parent cd56f94 commit e6738e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/build/copy-style-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ export const copyStyleFiles = () => {
if (err) return reject(err)
files.forEach((filename) => {
const filepath = path.resolve(cwd, filename)
const distPathEs = filepath
const distNameEs = filename
.replace(/src\//, 'esm/')
.replace(/src\\/, 'esm\\')
const distPathLib = filepath
const distNameLib = filename
.replace(/src\//, 'lib/')
.replace(/src\\/, 'lib\\')
const distPathEs = path.resolve(cwd, distNameEs)
const distPathLib = path.resolve(cwd, distNameLib)
fs.copySync(filepath, distPathEs)
fs.copySync(filepath, distPathLib)
})
Expand Down

0 comments on commit e6738e0

Please sign in to comment.