npm i @icreate/package
- Package:打包类
You can import the generated bundle to use the whole library generated by this starter:
import Package from '@icreate/package'
const Package = require('@icreate/package')
/**
* @description: 打包
* @param {dir} 目录
* @param {pkgFile} 包文件
*/
packageSync(dir: string, pkgFile: string): Promise<void>
/**
* @description: 合并脚本
* @param {dir} 目录
* @param {scriptFile} 脚本文件
*/
scriptSync(dir: string, scriptFile: string): Promise<void>
/**
* @description:写入数据到指定文件
* @param {file} 文件路径
* @param {data} 数据对象
*/
writeSync(file: string, data: Object): Promise<void>
/**
* @description:处理权限
* @param {routes} 路由数组
*/
permission(routes: Array<Route>): void
appPath: string = '/'
pageLoadTime = new Date()
toAbsAppPath(path: string): string
event: IEvent
ui: IBlockUI
log: ILogger
utils: Utils