linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 83 forks source link

How to use ng-classify before all coffee files are rendered? #288

Closed ramstein74 closed 9 years ago

ramstein74 commented 10 years ago

hello i would like to use ng-classify that processes coffee files. but as lineman also processes coffee files, how do i use ng-classify before lineman do its job on coffee files?

Thank you

searls commented 10 years ago

Hey @dmosher looked at this at one point I think, but he's on vacation. Anyone else?

On Wed, Jul 2, 2014 at 7:44 AM, Antonio notifications@github.com wrote:

hello i would like to use ng-classify that processes coffee files. but as lineman also processes coffee files, how do i use ng-classify before lineman do its job on coffee files?

Thank you

Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/288

searls commented 10 years ago

Maybe @foxandxss?

On Wed, Jul 2, 2014 at 9:22 AM, Justin Searls searls@gmail.com wrote:

Hey @dmosher looked at this at one point I think, but he's on vacation. Anyone else? On Wed, Jul 2, 2014 at 7:44 AM, Antonio notifications@github.com wrote:

hello i would like to use ng-classify that processes coffee files. but as lineman also processes coffee files, how do i use ng-classify before lineman do its job on coffee files?

Thank you

Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/288

Foxandxss commented 10 years ago

I never saw that library, just discovered it, uh, if Coffee wasn't enough to disturb Angular, that thing is horrendous.

Anyway, if there is a task for it, you should load it before the coffee one. Lineman allows that.

ramstein74 commented 10 years ago

Please tell me how to load a task before coffee task

Thank you

2014-07-03 11:21 GMT+01:00 Jesús Rodríguez Rodríguez < notifications@github.com>:

I never saw that library, just discovered it, uh, if Coffee wasn't enough to disturb Angular, that thing is horrendous.

Anyway, if there is a task for it, you should load it before the coffee one. Lineman allows that.

— Reply to this email directly or view it on GitHub https://github.com/linemanjs/lineman/issues/288#issuecomment-47889830.

Foxandxss commented 10 years ago

I Will leave that to @searls who knows the internals better than me.

The idea is to load classify > coffee > the rest

searls commented 10 years ago

In your application/config:

module.exports = (lineman) ->
  app = lineman.config.application

  prependTasks:
    common: app.prependTasks.common.concat("classify")
ramstein74 commented 10 years ago

i have my app/config/plugins/ngClassify.coffee

module.exports=(lineman) -> console.log "aaaaa" config: ngClassify: app: files: [ cwd: 'app/prejs' src: '*/.coffee' dest: 'app/js' expand: true ] options: appName: 'app'

and my app/tasks/ngClassify.coffee

module.exports = (lineman) -> app = lineman.config.application

prependTasks: common: app.prependTasks.common.concat("ngClassify")

I get this error now after lineman run loading ngClassify.coffee task ..."ERROR" type error cannot read property "prependTasks" of undefined

then i replaced prependTasks: common: app.prependTasks.common.concat("ngClassify")

by prependTasks: common: ['grunt-ng-classify']

and it works now but the watch task does not run on change inside my app/prejs folder.

where do i check the watch configuration?

davemo commented 9 years ago

Hi @ramstein74, you'll need to reference the name of the grunt task in prependTasks instead of the name of the grunt plugin (they aren't always the same).

For reference, grunt-ng-classify is the name of the plugin, the name of its grunt task is ngClassify which you can see here: https://github.com/CaryLandholt/grunt-ng-classify/blob/master/tasks/ngClassify.coffee#L4