1 Star 0 Fork 0

levin/imgToPixel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.js 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
lei.he 提交于 2018-12-17 15:56 . Initial commit
var ora = require('ora')
var rm = require('rimraf')
var chalk = require('chalk')
var webpack = require('webpack')
var CONFIG = require('./config')
var webpackConfig = require('./webpack.config')
var utils = require('./utils')
var ENV = process.env.NODE_ENV
const spinner = ora(`building for ${chalk.green(ENV)} ...`)
function packResult(err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
}
/* 任务开始 */
spinner.start()
/* 删除旧的编译文件 */
rm(utils.resolve(CONFIG.outputDir), err => {
if (err) throw err;
/* 打包新的文件 */
webpack(webpackConfig, packResult)
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/HLmagic/imgToPixel.git
git@gitee.com:HLmagic/imgToPixel.git
HLmagic
imgToPixel
imgToPixel
master

搜索帮助