2020-11-01 18:50:37 +08:00
|
|
|
// build icon is deprecated
|
|
|
|
// it is kept for backward compitability
|
|
|
|
// it will be removed in next major version
|
|
|
|
// warning info should be added
|
|
|
|
// using `vicons` is a recommend way for users to use icons
|
|
|
|
|
2020-12-06 22:04:36 +08:00
|
|
|
const fs = require('fs-extra')
|
2020-02-12 16:21:42 +08:00
|
|
|
const path = require('path')
|
|
|
|
|
2020-11-01 18:50:37 +08:00
|
|
|
const iconPath = path.resolve(__dirname, '..', 'src', '_deprecated', 'icons')
|
2020-02-12 16:21:42 +08:00
|
|
|
|
|
|
|
const cjsIconPath = path.resolve(__dirname, '..', 'lib', 'icons')
|
|
|
|
const esmIconPath = path.resolve(__dirname, '..', 'es', 'icons')
|
|
|
|
|
|
|
|
function createDirIfNotExists (...args) {
|
|
|
|
if (!fs.existsSync(path.resolve(...args))) {
|
|
|
|
fs.mkdirSync(path.resolve(...args))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
createDirIfNotExists(__dirname, '../lib')
|
2020-12-06 22:04:36 +08:00
|
|
|
fs.copySync(iconPath, cjsIconPath)
|
2020-02-12 16:21:42 +08:00
|
|
|
createDirIfNotExists(__dirname, '../es')
|
2020-12-06 22:04:36 +08:00
|
|
|
fs.copySync(iconPath, esmIconPath)
|