@stylable/rollup-plugin

Stylable plugin for Rollup

Usage no npm install needed!

<script type="module">
  import stylableRollupPlugin from 'https://cdn.skypack.dev/@stylable/rollup-plugin';
</script>

README

@stylable/rollup-plugin

npm version

Installation

npm i @stylable/rollup-plugin -D

or

yarn add @stylable/rollup-plugin --dev

Usage

// rollup.config.js
import stylable from "@stylable/rollup-plugin";

export default {
    ...
    plugins: [ stylable() ]
}

If you use any other rollup CSS plugins you should exclude Stylable files (*.st.css) from them.

Plugin Options

interface StylableRollupPluginOptions {
    minify?: boolean;
    inlineAssets?: boolean;
    fileName?: string;
    diagnosticsMode?: 'auto' | 'strict' | 'loose';
    resolveNamespace?: (namespace: string, source: string) => string;
}

This package provides naive Stylable rollup plugin. It is in early development stages and may not behave expectedly in all cases. Please open a PR/issue if you encounter any problems.

License

Copyright (c) 2021 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by an MIT license.