babel-plugin-template-css-minifier

1.0.0 • Public • Published

babel-plugin-template-css-minifier Build status Latest Release License

This Babel plugin minifies CSS code embedded within a template literal. Simply tag the template literal with a leading /* css */ comment to activate the plugin.

Example

Input

const css = /*css*/`
  body {
    height: 100%;
  }
`;

Output

const css = /*css*/`body{height: 100%;}`;

Configuration

The plugin doesn't require any configuration in itself. Your .babelrc file can be as simple as this:

.babelrc

{ "plugins": ["babel-plugin-template-css-minifier"] }

Due to Babel's first-to-last plugin ordering, this plugin should be placed at or near the beginning of the list of plugins so that it runs before template literals are transformed by another plugin.

Package Sidebar

Install

npm i babel-plugin-template-css-minifier

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

6.92 kB

Total Files

6

Last publish

Collaborators

  • nsaunders