Easy way to precompile Emberjs Handlebar templates with nodejs?

前端 未结 8 1718
耶瑟儿~
耶瑟儿~ 2021-02-01 09:59

I\'m enjoying emberjs a lot and would like to take the next step in a couple of my small, mobile apps and precompile my Ember/Handlebars templates as part of my build process.

相关标签:
8条回答
  • 2021-02-01 10:27

    window object can be mocked by jsdom

        var jsdom = require("jsdom").jsdom;
        global.document = jsdom("<html><head></head><body></body></html>");
        global.window = document.createWindow();
        global.$ = global.jQuery = window.$ = window.jQuery = require("jquery");
        global.Handlebars = window.Handlebars = require('handlebars');
        global.Application = window.Application = {};
        require('ember.js');
    

    and now you can run anything from Ember including Ember.Handlebars.compile

    0 讨论(0)
  • 2021-02-01 10:28

    Take a look at the npm package Ember-Runner

    0 讨论(0)
提交回复
热议问题