Coder Social home page Coder Social logo

gulp-ember-templates's People

Contributors

nicknystrom avatar nulle avatar swelham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gulp-ember-templates's Issues

amd wrapper is broken

This line
https://github.com/swelham/gulp-ember-templates/blob/master/index.js#L33

Should be something like:
var prefix = 'define(["' + 'ember' + '"], function (Ember) { return ';

Edit:
Actually this way multiple templates gets into one file with multiple defines. I had to do something like this to make this work.

var amdModulePrefix = 'define(["ember"], function(Ember) {',
    amdModulePostfix = '});';

return gulp.src(['app/client/templates/**/*.hbs'])
    .pipe($.emberTemplates({
        type: 'browser'
    }))
    .pipe($.concat('common.js'))
    .pipe($.insert.wrap(amdModulePrefix, amdModulePostfix))
    .pipe(gulp.dest('public/assets/templates'));

Generated names for nested templates will not work when compiling on Windows

This is due to the eternal backslash hell that is Windows, which is not unlike driving on the left or still use Imperial units, IMHO.

Anyways, this can be easily mitigated by patching the Gulpfile with something like:

var templatesOptions = /^win/.test(process.platform) ? {
  name: { replace: /\\/g, with: '/' }
} : {};

But it could help to integrate this check somewhere on the plugin or mention it on the doumentation.

Thanks !

How do you compile components?

Hi.
I can't figure out how to compile components.

I have this in my gulpfile.js:

gulp.task('templates', function () {
  gulp.src(src + "templates/**/*.hbs")
    .pipe(emberTemplates({
      compiler: require('./bower_components/ember/ember-template-compiler'),
      isHTMLBars: true
    }))
    .pipe(gulp.dest(src + 'assets/js'));
});

I have all my components in templates/components/ but they're compiled as normal templates instead of components.

I'm using the latest version. v0.7.1.

I'm a bit unsure if this plugin does support it, but I believe I saw a recent commit about components.
Anyway, thanks for the plugin.

Reason for substringing before '/' in transformedName?

Is there a use case for substringing the '/' in transformedName on line 61 of index.js?

var transformedName = name.split('/').slice(-1)[0].toString();

I've found this line of code breaks the template path to components, making my Ember application break. When I no longer do the .split, my templates compile correctly.

I'd like to submit a pull request but wanted to double check first if there were use cases that needed the transformedName split by '/' and substringed. Please let me know, thanks!

Deprecate in favor of gulp-handlebars

version 2.2.0 of gulp-handlebars supports using Ember's Handlebars compiler and includes both a simple example and complex example that show how to use it to compile templates for Ember.js.

gulp-ember-handlebars is being deprecated as a result and it would make sense to do the same here to avoid fragmentation in the community.

@swelham , would you be opposed to deprecating gulp-ember-templates?

If there is functionality in gulp-ember-templates you feel that gulp-handlebars does not offer, please file an issue or submit a PR, but be mindful of the gulp plugin guidelines as gulp-ember-templates does not adhere to them in its current form. @phated

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.