Bash web包-很棒的typescript加载程序插件:如何检测[at加载程序]进程结束

Bash web包-很棒的typescript加载程序插件:如何检测[at加载程序]进程结束,bash,webpack,Bash,Webpack,在webpack构建脚本中,“awesome typescript loader”作为一个单独的进程启动。当webpack退出时,这个单独的过程尚未完成,因此我无法运行PM2重新加载过程 有没有办法检测到这一单独过程的结束,以便按时正确启动PM2重新加载 为了检查网页时间线,我添加了一个特定的插件 new WebpackShellPlugin({onBuildStart:['echo "Webpack Start"'], onBuildEnd:['echo "Webpack End"'], o

在webpack构建脚本中,“awesome typescript loader”作为一个单独的进程启动。当webpack退出时,这个单独的过程尚未完成,因此我无法运行PM2重新加载过程

有没有办法检测到这一单独过程的结束,以便按时正确启动PM2重新加载

为了检查网页时间线,我添加了一个特定的插件

new WebpackShellPlugin({onBuildStart:['echo "Webpack Start"'],
 onBuildEnd:['echo "Webpack End"'], onBuildExit:['echo "Webpack Exit"']})
运行:

 node_modules/.bin/webpack --config webpack.config.prod.js --progress --profile --bail 
控制台日志:

@example.com Executing pre-build scripts
@example.com "**Webpack Start**". # echo from  WebpackShellPlugin
@example.com 
@example.com [at-loader] Using typescript@2.0.10 from typescript and "tsconfig.json" from /opt/hello-angular/releases/20161206103220/tsconfig.json
@example.com 
@example.com [at-loader] Checking started in a separate process...

    # is there a way to keep track this process ?

@example.com 
@example.com [at-loader] Ok, 5.531 sec.
@example.com Executing post-build scripts
@example.com "**Webpack End**"  # echo from WebpackShellPlugin
@example.com Executing additional scripts before exit
@example.com "**Webpack Exit**". # echo from WebpackShellPlugin
@example.com Hash: 5c4be87232dc5ea6d7fa
@example.com Version: webpack 2.1.0-beta.27
@example.com Time: 70161ms
@example.com     Asset    Size  Chunks             Chunk Names
@example.com bundle.js  376 kB       0  [emitted]  app
@example.com     + 441 hidden modules
...
....  # [at-loader] output  long process ....
5693ms asset optimization
....
@358ms emitting
localhost$.  #  [at-loader] process finished )
    is there a way to get warned when the separate process ends up, and run my pm2 start command at this point ?

我在shipit任务中使用回调函数找到了一个解决方案

// this task builds the Angular bundle in the release folder
shipit.blTask('build_script', function () {
    shipit.remote('cd '+ shipit.releasePath + ' && npm run build:' + env).then(function (res) {
        console.log("WEBPACK BUILD CALLBACK FUNCTION... NOW RESTART PM2");
        shipit.start('pm2-startOrReload');
    });
});