Rollup.js integration

Integration example for the Rollup.js can be found in integrations examples repository .

How to integrate the Stylify into the Rollup.js

First install the @stylify/unplugin package using NPM or Yarn:

npm i -D @stylify/unplugin
yarn add -D @stylify/unplugin

Next, add create a configuration file rollup.config.js:

const { rollupPlugin } = require('@stylify/unplugin');
const postcss = require('rollup-plugin-postcss');

const stylifyPlugin = rollupPlugin({
    dev: true,
    transformIncludeFilter: (id) => id.endsWith('html'),
    bundles: [{
        files: ['./index.html'],
        outputFile: './index.css'
    }]
});

export default {
  input: 'input.js',
  plugins: [stylifyPlugin, postcss()],
  output: { file: 'index.js', format: 'umd' }
};

Now you can run build command. This will generate the stylify.css and mangle selectors in files, if selected.

Where to go next?