How to use the @glimmer/compiler/package.json.version function in @glimmer/compiler

To help you get started, we’ve selected a few @glimmer/compiler 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 / glimmer-compiler / index.js View on Github external
import compileModule from '../../../utils/compileModule';
import pkg from '@glimmer/compiler/package.json';

const ID = 'glimmer-compiler';

export default {
  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage || 'https://github.com/glimmerjs/glimmer-vm',

  defaultParserID: 'glimmer',

  loadTransformer(callback) {
    require(
      ['../../../transpilers/babel', '@glimmer/compiler'],
      (transpile, glimmer) => callback({ transpile: transpile.default, glimmer }),
    );
  },

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

    // allow "export default" instead of "module.exports = "

@glimmer/compiler

MIT
Latest version published 2 months ago

Package Health Score

77 / 100
Full package analysis

Similar packages