Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing ES6 support for latest version of gulp #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added missing ES6 support for latest version of gulp #149

wants to merge 1 commit into from

Conversation

adityaparab
Copy link

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

  • README.md
  • package.json

@@ -62,6 +62,11 @@
"type": "git",
"url": "https://github.com/angularclass/NG6-starter.git"
},
"babel": {
Copy link
Collaborator

@fesor fesor Jun 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have .babelrc, isn't it enough?

Maybe move content of .babelrc here and remove it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, it should be enough to have it in .babelrc. Unfortunately, that didn't work for me. May be that is because I don't have babel installed globally.

Wouldn't be better if we have it at both places to ensure the build doesn't fail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants