bkui-cli-template-webpack4-saas
Version:
bkui-cli-template-webpack4-saas
22 lines (18 loc) • 507 B
JavaScript
/**
* @file 检测 dll
* @author <%- author %>
*/
import path from 'path'
import fse from 'fs-extra'
import npm from 'npm'
const manifestExist = fse.pathExistsSync(path.resolve(__dirname, '..', 'static', 'lib-manifest.json'))
const bundleExist = fse.pathExistsSync(path.resolve(__dirname, '..', 'static', 'lib.bundle.js'))
if (!(manifestExist & bundleExist)) {
npm.load({}, () => {
npm.run('dll', err => {
if (err) {
throw err
}
})
})
}