1.0.9 • Published 1 year ago

@ouweiya/rollup-plugin-tailwindcss v1.0.9

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

Install

npm i @ouweiya/rollup-plugin-tailwindcss -D

Usage

rollup.config.js

import tailwindcss from '@ouweiya/rollup-plugin-tailwindcss';

export default {
  ...
  plugins: [tailwindcss({ patterns: 'index.css', rootDir: 'src' })],
};

Configuration

tailwindcss({
  rootDir: 'src',
  patterns: 'index.css',
  name: 'customName.css',
});

rootDir

Type: string

default: Root directory

patterns

Type: string

required: true

name

Type: string

default: patterns

postcss.config.js

Use the ES module for the configuration file and add "type": "module" in package.json.

Minimize CSS code after compiling tailwindcss.

import tailwindcss from 'tailwindcss';
import cssnano from 'cssnano';

export default {
  plugins: [
    tailwindcss,
    cssnano({ preset: ['default', { discardComments: { removeAll: true } }] })
  ],
};

Dev and Prod

import tailwindcss from 'tailwindcss';
import cssnano from 'cssnano';

const isDevelopment = process.argv.some(arg => /--watch|-w|dev-server/.test(arg));

const plugins = isDevelopment
  ? [tailwindcss]
  : [tailwindcss, cssnano({ preset: ['default', { discardComments: { removeAll: true } }] })];

export default {
  plugins,
};
1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago