Wednesday, 15 April 2015

gruntjs - Using coffeescript with basic Yeoman project. -



gruntjs - Using coffeescript with basic Yeoman project. -

i've used yeoman create quick project skeleton using yo webapp generator command. in resulting gruntfile see it's setup compile coffeescript seems sticking compiled files in tmp folder.

coffee: { dist: { files: { '.tmp/scripts/coffee.js': '<%= yeoman.app %>/scripts/*.coffee' } }, },

how these included in project during development. i'm not using requirejs.

the yeoman docs unclear on how utilize coffeescript. mention gets automatically compiled.

using yeomen 1.0.0-rc1.4. use:

$ yo angular --coffee

the resulting project has controller , app scripts in coffeescript.

grunt configuration file remains in js (what not problem).

running

$ grunt test

runs tests , seems fine.

$ grunt server

is doing 1 expects (build app, test it, starts server, opens app in web browser , starts watching changes, if alter coffee script file, reflected in web broser.

documentation states, 1 can utilize yo add together particular pieces

angular:controller angular:directive angular:filter angular:route angular:service angular:decorator angular:view

each can called --coffee switch , script in coffeescript, e.g.:

yo angular:controller user --coffee

coffeescript gruntjs yeoman

No comments:

Post a Comment