babel-plugin-transform-tag-template-literals

0.1.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?

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

    Package Sidebar

    Install

    npm i babel-plugin-transform-tag-template-literals

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    8 kB

    Total Files

    20

    Last publish

    Collaborators

    • rhumaric