How to use @babel/plugin-transform-template-literals - 1 common examples

To help you get started, we’ve selected a few @babel/plugin-transform-template-literals 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 carbon-design-system / carbon-custom-elements / babel-plugin-create-react-custom-element-type.js View on Github external
`,
        ];
      }
      if (context.parentDescriptorSource) {
        body.unshift(
          t.importDeclaration(
            [t.importSpecifier(t.identifier('parentDescriptor'), t.identifier('descriptor'))],
            t.stringLiteral(context.parentDescriptorSource)
          )
        );
      }
      if (context.hasNamedExport) {
        body.unshift(t.exportAllDeclaration(retargedPath));
      }
      const program = t.program(body);
      traverse(program, transformTemplateLiterals(api).visitor, path.scope, path);
      path.replaceWith(program);
      path.stop();
    },
  };

@babel/plugin-transform-template-literals

Compile ES2015 template literals to ES5

MIT
Latest version published 26 days ago

Package Health Score

95 / 100
Full package analysis

Popular @babel/plugin-transform-template-literals functions