0.1.2 • Published 1 year ago

jsx-trim v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

WARNING: In development, not tested in production. You should probably wait for the first major version.

JSX trim

npm package Downloads Issues

jsx-trim.png

Using multiline template strings to set jsx classnames?

You might have seen all the extra whitespace in your html output, which makes using the browser devtools a pain. Use this transformer to get rid of consecutive, leading and trailing whitespaces in classname attributes.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

npm install jsx-trim
yarn add jsx-trim

Usage

Babel

Add the plugin to your babel config

[
  "@babel/plugin-transform-react-jsx",
  { runtime: 'automatic', importSource: 'jsx-trim' }
]

vite:

With @vitejs/plugin-react installation is just one line.

export default defineConfig(() => ({
  plugins: [
    react({
      jsxImportSource: 'jsx-trim'
    })
  ]
}));

Changelog

Please see releases for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.