UNPKG

@edwardxyt/gws-cli

Version:

这是一个web脚手架工具,用于生成基于webpack5,生成typescript+react17+mobx5+reactRouter6的应用。初衷是要解决多入口,多环境。单独编译单独运行的脚手架。做到小而美。拒绝锦上添花。

37 lines (34 loc) 1.2 kB
const webpack_production_config = require("../config/webpack.production.config"); const webpack = require("webpack"); const path = require("path"); const debug = require("debug"); const R = require("ramda"); const echo = debug("compile:bin"); const log = console.log; let app_config = require("../config")(path.resolve(__dirname, "../")); webpack_production_config().then(config => { webpack(config).run((err, stats) => { if (err) { echo("webpack compile fail 编译错误!"); echo(err); } else { echo( `------------------------------ start ------------------------------` ); process.stdout.write( stats.toString({ colors: true, modules: false, children: false, chunks: false, warnings: false, chunkModules: false }) + "\n\n" ); echo("webpack compile vendor complete 编译完成"); echo( `------------------------------- end ------------------------------` ); } }); });