Crates.io | swc_plugin_emotion |
lib.rs | swc_plugin_emotion |
version | 0.12.4 |
source | src |
created_at | 2021-07-05 04:22:00.251422 |
updated_at | 2022-11-10 01:39:52.484931 |
description | SWC plugin for https://www.npmjs.com/package/babel-plugin-transform-imports |
homepage | |
repository | |
max_upload_size | |
id | 418867 |
size | 6,109 |
The official plugin for emotion css-in-js library.
The plugin uses the same config as described in Next emotion documentation.
{
jsc: {
...
experimental: {
plugins: [ ['@swc/plugin-emotion', {
// default is true. It will be disabled when build type is production.
sourceMap?: boolean,
// default is 'dev-only'.
autoLabel?: 'never' | 'dev-only' | 'always',
// default is '[local]'.
// Allowed values: `[local]` `[filename]` and `[dirname]`
// This option only works when autoLabel is set to 'dev-only' or 'always'.
// It allows you to define the format of the resulting label.
// The format is defined via string where variable parts are enclosed in square brackets [].
// For example labelFormat: "my-classname--[local]", where [local] will be replaced with the name of the variable the result is assigned to.
labelFormat?: string,
}] ]
}
}
Source code for plugin itself (not transforms) are copied from https://github.com/IvanRodriCalleja/emotion-swc-plugin