1-9 使用gulp-typescript进行es6转译

海通社区优化

1.经过改造,现在支持es6的转译了。使用gulp-typescript插件将es6文件夹下的js转译为es5,并加上controller后缀,这样项目里就能直接用了

//es6组件编译
gulp.task('es6Compile', () => {
  
  return gulp
    .src('./app/js/es6/*.js')
    .pipe(
      ts({
        allowJs: true,
        target: 'es5',
        removeComments: true,
        noImplicitAny: true,
      })
    )
    .pipe(rename({suffix: ".controller"}))
    .pipe(gulp.dest('./app/js/controllers'));
});

猜你喜欢

转载自blog.csdn.net/qq_36620428/article/details/86212508