8 Star 23 Fork 3

Gitee 极速下载 / codecombat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/codecombat/codecombat
克隆/下载
runWebpack.js 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
/**
* NPM post-install middleware.
* By default runs webpack.
*
* Set SKIP_WEBPACK=true` to skip the webpack build.
* Set `DELETE_DEPENDENCIES=true` to delete node_modules and bower_components.
* Useful when building the client for only the `public` folder.
*/
const cp = require("child_process");
const spawn = cp.spawn;
const exec = cp.exec;
const remove_dependencies = () => {
const rm = exec("rm -rf node_modules && rm -rf bower_components");
return rm;
};
if (process.env.SKIP_WEBPACK === "true") {
console.log("Skipping webpack build because SKIP_WEBPACK=true");
} else {
const command = spawn("webpack");
command.stdout.on("data", function(data) {
process.stdout.write(data);
});
command.stderr.on("data", function(data) {
process.stdout.write(data);
});
command.on("exit", () => {
// Use when we only need the public folder.
if (process.env.DELETE_DEPENDENCIES === "true") {
console.log(
"Cleaning up dependencies because `DELETE_DEPENDENCIES=true`."
);
remove_dependencies();
}
});
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/codecombat.git
git@gitee.com:mirrors/codecombat.git
mirrors
codecombat
codecombat
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891