@semcore/babel-plugin-react-semcore

Utility for @semcore component's styles manipulations.

Usage no npm install needed!

<script type="module">
  import semcoreBabelPluginReactSemcore from 'https://cdn.skypack.dev/@semcore/babel-plugin-react-semcore';
</script>

README

babel-plugin-react-semcore

Utility for @semcore component's styles manipulations.

Install

yarn:

$ yarn add babel-plugin-react-semcore -D

Usage

Webpack:

{
    test: /\.js$/,
    include: /\/node_modules\/semcore\//,
    enforce: 'pre',
    use: {
        loader: require.resolve('babel-loader'),
        options: {
            babelrc: false, // optional, include if u use .babelrc
            configFile: false, // optional, include if u use babel.config.js, doesnt affect babelrc option https://babeljs.io/docs/en/options#configfile
            plugins: [['babel-plugin-react-semcore', {
              ...pluginOptions
            }]]
        },
    },
}

Options

Option Type Description
media boolean This option enables adaptive styles in @semcore components
theme string or string[] This option applies theme to @semcore components.
purgeCSS Object = { shorten: false } This option forwards options to css-purge tool, which removes duplicates from built styles