How to use the ember-source/dist/ember-template-compiler.precompile function in ember-source

To help you get started, we’ve selected a few ember-source examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rwjblue / ember-angle-bracket-invocation-polyfill / lib / sample-compile-script.js View on Github external
'use strict';
/* eslint-disable node/no-unpublished-require */

/*
  This script is pretty useful for launching a single template compilation
  with our script:

  node --inspect-brk lib/sample-compile-script.js
*/

const compiler = require('ember-source/dist/ember-template-compiler');
compiler.registerPlugin('ast', require('./ast-transform'));

let template = '<@nav.item />';
let output = compiler.precompile(template, { contents: template });
console.log(output); // eslint-disable-line no-console