How to use the ember-template-recast/package.json.homepage function in ember-template-recast

To help you get started, we’ve selected a few ember-template-recast 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 fkling / astexplorer / website / src / parsers / handlebars / transformers / ember-template-recast / index.js View on Github external
import compileModule from '../../../utils/compileModule';
import pkg from 'ember-template-recast/package.json';

const ID = 'ember-template-recast';

export default {
  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage || 'https://github.com/ember-template-lint/ember-template-recast',

  defaultParserID: 'ember-template-recast',

  loadTransformer(callback) {
    require(
      ['../../../transpilers/babel', 'ember-template-recast'],
      (transpile, recast) => callback({ transpile: transpile.default, recast }),
    );
  },

  transform({ transpile, recast }, transformCode, code) {
    transformCode = transpile(transformCode);
    const transformModule = compileModule(transformCode);

    // allow "export default" instead of "module.exports = "
    const transform = transformModule.__esModule ?

ember-template-recast

Non-destructive template transformer.

MIT
Latest version published 5 months ago

Package Health Score

76 / 100
Full package analysis