Hook into angular-cli build watch

后端 未结 5 537
南方客
南方客 2020-12-06 10:06

I\'d like to to know if it is possible to hook into angular-cli\'s build/watch command:

ng build /w

which generates files and dr

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 10:59

    You should create your own node build script which calls the ng build command and after that copies the files to a directory:

    let thread = exec('ng build -e=prod --prod', { maxBuffer: 1024 * 5000});
    thread.on('close', (data) => {
        //do your moving stuff here
    });
    

    There is no way to hook into the cli (yet), and I don't think they will allow it. As far as I remember, they like to keep things closed there, because this way they are able to change/tune/update the build process a lot, without older builds going haywire

提交回复
热议问题