Skip to content

Commit 4d60568

Browse files
committed
simplify logic to copy font to build directory
1 parent ebc069f commit 4d60568

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

gulp.d/tasks/build.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ module.exports = (src, dest, preview) => () => {
4444
const abspath = require.resolve(relpath)
4545
const basename = ospath.basename(abspath)
4646
const destpath = ospath.join(dest, 'font', basename)
47-
if (!fs.existsSync(destpath)) {
48-
fs.mkdirSync(ospath.join(dest, 'font'), { recursive: true })
49-
fs.copyFileSync(abspath, destpath)
50-
}
47+
if (!fs.existsSync(destpath)) fs.cpSync(abspath, destpath, { recursive: true })
5148
return path.join('..', 'font', basename)
5249
},
5350
},

0 commit comments

Comments
 (0)