shuhei/babel-angular2-app

Babel missing?

wootencl opened this issue ยท 10 comments

Excellent intro to Angular2 and Babel so thanks for that! Just cloned the project to mess around with it and noticed when trying to build that babel seemed to be missing. Investigating further I noticed there was no reference in the package.json. With that, I just added this to the top of the list:

"babel": "^6.5.2",
"babel-core": "^6.9.0",

Outside of that, thanks again! I think I'm going to fork your project and modify it for express.js and livereload.

I'm glad that you like it!

babel-core should be installed because it's a dependency of babelify that is a devDependency of this repo. Would you try deleting node_modules and npm install again?

Also, babel package is now deprecated. If you want babel command, please install babel-cli.

Thanks for the prompt reply @shuhei. At work at the moment but I'll give it a shot when I get back to my house

Sorry for the slight delay. So I tried it again and you are definitely right about it installing as a dependency to babelify. Still not working though sadly. The only reason I can think it's not working is because it resides in babelify's node_modules directory and not the projects main node_modules directory.

Ah, I see. I had to add babel-core to package.json because the gulpfile uses babel.

Do you use npm 2? npm 3 will work for you because it flattens node_modules.

Thanks for pointing out!

Wow. I feel not so smart. Haven't updated npm in while so I completely overlooked that. That was the exact problem. Having now updated everything works perfectly. Thanks for the help!

By the way. Here's the repo I created based off your project: Angular_Foundation_Skeleton. Similar concept but I'm using node (via express) and the foundation framework for responsiveness.

Nice one! How about adding server-side rendering?

Working on it at the moment. Don't have a ton of experience with front end testing sadly ๐Ÿ˜ž. So I've been working my way through the systems you're using: Karma, Jasmine, Protractor, Phantom. Out of curiosity what's your opinion on Angular Universal's server side rendering approach?

I haven't looked at Angular Universal in details, but server-side rendering is great for the sake of performance and SEO. I guess it should work well because the Angular team has worked hard to make the Angular 2 core independent from DOM :-)

+1 for server rendering :) would be awesome to use only JS for everything :)