Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 = "
const transform = transformModule.__esModule ?