🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

babel-plugin-template-css-minifier

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-template-css-minifier

Minifies CSS embedded in template literals.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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.

Keywords

babel

FAQs

Package last updated on 27 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts