2

My project is a hybrid AngularJS / Angular project and we are using gulp to perform the following transformation on the Angular part. TS -> ES6 -> BABEL (ES5+) -> Rollup or SystemJS And alot of gulp watch and caching and Map-magic

I would like this to be more standard using angular cli but cannot find a way to do the babel transform in angular cli. I want it to be able to gradually move to ES6 and beyond as supported platforms allow but also want to keep map files working.

Is there a way to tie Babel into Angular-cli and keep map files through the whole process?

I have tried a broccoli build before I went with gulp but could not get all plugins to work with map files there and since Angular Cli is based on broccoli I can't find a way.

Please help out. :)

4

1 回答 1

1

为了完整起见,如果其他人看到这个:

基本上,使用 webpack 来捆绑 Angular 构建。这是检查所有框的唯一方法:

  • ts -> aot -> js -> 打包 -> 优化改造链
  • 跨多个构建步骤的源映射
  • 多个输出
  • 观看模式

但!您不必使用 ng CLI 来执行此操作,实际上它使操作变得更加困难,因为您很可能拥有大量不符合所有操作指南的 AngularJS 投资。

我最终将 gulp 作为主要构建框架,并使用 gulp-webpack 包在 gulp 任务中为 Angular 构建调用 webpack。我最近遇到的唯一限制是,我只想在该目录中至少有 1 个文件更改时才运行 webpack(在非监视模式下)。似乎 gulp-webpack 在流为空时也会执行。

于 2018-01-18T19:37:34.970 回答