https://github.com/luncheon/rollup-plugin-purgecss-keep-string-literals
An experimental rollup plugin that removes the rest of the CSS, leaving only the selectors used in the string literals in the JavaScript source code.
https://github.com/luncheon/rollup-plugin-purgecss-keep-string-literals
purgecss rollup rollup-plugin tailwindcss
Last synced: 2 months ago
JSON representation
An experimental rollup plugin that removes the rest of the CSS, leaving only the selectors used in the string literals in the JavaScript source code.
- Host: GitHub
- URL: https://github.com/luncheon/rollup-plugin-purgecss-keep-string-literals
- Owner: luncheon
- License: wtfpl
- Created: 2020-11-20T06:31:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-20T09:29:36.000Z (over 4 years ago)
- Last Synced: 2025-02-12T16:28:09.081Z (4 months ago)
- Topics: purgecss, rollup, rollup-plugin, tailwindcss
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @luncheon/rollup-plugin-purgecss-keep-string-literals
An experimental rollup plugin that removes the rest of the CSS, leaving only the selectors used in the string literals in the JavaScript source code.
## Installation
```bash
$ npm i -D rollup @luncheon/rollup-plugin-purgecss-keep-string-literals
```## Usage
```js
// rollup.config.js
import purgecssKeepStringLiterals from '@luncheon/rollup-plugin-purgecss-keep-string-literals'export default {
plugins: [
purgecssKeepStringLiterals({
css: ["node_modules/tailwindcss/dist/utilities.min.css"],
output: "dist/utilities.css",
include: ["src/**/*.ts"],
})
]
}
```## Options
### `css`
Type: `(string | { raw: string })[]`
Array of the CSS file name or the CSS content.
### `output`
Type: `string`
Output file name.
### `include`
Type: `string | string[]`
Default: `null`Minimatch pattern(s) for which the plugin should collect the string literals. By default all bundled files are targeted.
### `exclude`
Type: `string | string[]`
Default: `null`Minimatch pattern(s) for which the plugin should ignore. By default no files are ignored.
## License
[WTFPL](http://www.wtfpl.net)