@impjs/babel-plugin-transform-tag-template-literals

0.0.1-alpha.1 • Public • Published

babel-plugin-transform-tag-template-literals

A Babel transform that tags each non-tagged template literal with a chosen identifier.

`a template ${literal}`

// Will become

html`a template ${literal}`

Usage

Usage

Install the plugin with your favourite package manager. For example, with NPM:

npm install --save-dev babel-plugin-transform-last-statement

Then in your Babel configuration, add it to the list of plugins:

{
  plugins:['transform-tag-template-literals']
}

Options

  • tagName: The identifier to use for the tag function. If empty, the plugin won't try to tag anything

Possible future work

  • [ ] Allow to set which tagName to use through a comment, like // tag-template-literals: tagName. Some thoughts will be needed for the scoping. Apply to next block (function,if...) or maybe use a // end-tag-template-literals?

Readme

Keywords

none

Package Sidebar

Install

npm i @impjs/babel-plugin-transform-tag-template-literals

Weekly Downloads

1

Version

0.0.1-alpha.1

License

MIT

Unpacked Size

6.99 kB

Total Files

14

Last publish

Collaborators

  • rhumaric