PatrickJS / NG6-starter

:ng: An AngularJS Starter repo for AngularJS + ES6 + Webpack
https://angularclass.github.io/NG6-starter
Apache License 2.0
1.91k stars 1.35k forks source link

Added missing ES6 support for latest version of gulp #149

Open adityaparab opened 8 years ago

adityaparab commented 8 years ago

With latest version of gulp, we get following error when we build the application

/Volumes/UUI/Jedi/gulpfile.babel.js:3
import gulp from 'gulp';
^^^^^^
SyntaxError: Unexpected token import
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:511:25)
    at loader (/Volumes/UUI/Jedi/node_modules/babel-register/lib/node.js:158:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Volumes/UUI/Jedi/node_modules/babel-register/lib/node.js:168:7)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)

Latest version of gulp doesn't automatically transpile gulpfile which is written in ES6. We need additional dependecy gulp-cli for latest version of gulp.

Additionally, we also need to set babel preset config in either .babelrc or in our package.json. Added this in package.json as well.

Changed files