Giter VIP home page Giter VIP logo

Comments (9)

dgeb avatar dgeb commented on August 28, 2024

Please see my comment here https://github.com/dgeb/grunt-contrib-ember/issues/1#issuecomment-9004473 and let me know if you're still having trouble.

from grunt-ember-templates.

xMartin avatar xMartin commented on August 28, 2024

So $ yeoman ember_handlebars works. Also $ yeoman ember_handlebars reload does work (gives a warning <WARN> Cannot call method 'reload' of undefined Use --force to continue. </WARN> though.

I have ember_handlebars in initConfig and also in watch as in your example and it does nothing when I enter yeoman server. Also no output about ember.

from grunt-ember-templates.

dgeb avatar dgeb commented on August 28, 2024

Have you tried cloning and running my example directly? https://github.com/dgeb/yeoman-ember-basic-example

After cloning, browse to the dir, run npm install grunt-contrib-ember, then yeoman ember_handlebars, then yeoman server (these steps will be reduced if this plugin gets added to yeoman itself).

from grunt-ember-templates.

xMartin avatar xMartin commented on August 28, 2024

Ok, actually it works but only if I do $ yeoman ember_handlebars before running the server. I expected it to work with just running the server. Is this expected behavior? If yes, would be good to add it to the README.

Thanks a lot for your support!

from grunt-ember-templates.

dgeb avatar dgeb commented on August 28, 2024

Glad you got it working, but I agree that the extra step shouldn't be necessary. I'll leave this ticket open and try to tackle that soon.

from grunt-ember-templates.

xMartin avatar xMartin commented on August 28, 2024

I'm afraid there's no way to cleanly plug the task in somewhere. My own solution is to add the following to the end of the Gruntfile:

  // We need to add task 'ember_templates' to almost all tasks.
  // By adding it to 'clean' we make sure it is called whenever something new
  // is started so this seems to be the "cleanest" hack at the moment.
  grunt.renameTask('clean', 'yeoman-clean');
  grunt.registerTask('clean', 'yeoman-clean ember_templates');

from grunt-ember-templates.

nhoffmann avatar nhoffmann commented on August 28, 2024

I found this in the example @dgeb provided and put it in my Gruntfile.js:

watch: {
  ...
  ember_templates: {
    files: 'app/scripts/**/*.handlebars',
    tasks: 'ember_templates reload'
  },
  ...
}

The templates get recompiled when I change any of the .handlebars files. Does it mean, that this issue is fixed by now?

If so, shouldn't this be added to the example?

from grunt-ember-templates.

dgeb avatar dgeb commented on August 28, 2024

@xMartin thanks for your workaround! I added it to my example until there's a cleaner way to customize tasks.

@nhoffmann Good idea - I probably should add the watch example to my plugin's README. You're right that, with this configuration change, templates get recompiled when any .handlebars file changes are made. This has always worked. However, the annoyance that @xMartin has worked around is the need to explicitly run yeoman ember_handlebars with a fresh app or after a clean. Ideally, there should be a "cleaner" way to modify tasks.

from grunt-ember-templates.

dgeb avatar dgeb commented on August 28, 2024

The README now includes ember_templates configuration and watch examples. I'm going to leave out yeoman-specific configuration steps for now.

from grunt-ember-templates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.