Skip to content

Add JSDoc typings to main export #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ import { createProcessor } from 'rollup-copy-transform-css'
import cssToModule from './css-to-module.js'
import handleError from './error.js'

/**
* lit CSS rollup plugin
*
* @param {Object} opts Options
* @param {string[]} [opts.include] Pattern to match files which will be processed by the plugin.
* @param {string[]} [opts.exclude] Pattern to match files which will be ignored by the plugin.
* @param {Object} [opts.options] Options for the Sass compiler. Use any options supported by the `compileString`
* method from the Sass package.
* @param {boolean|Object} [opts.minify] Enables minifying of the transformed CSS output. If an object is specified, it
* will be passed to the cssnano plugin.
* @param {boolean|Object} [opts.inline] Enables inlining of stylesheets and other assets. If an object is specified,
* it will have to include two properties pointing to objects: { stylesheets, assets }. The stylesheets objects will
* be passed to the postcss-import plugin. The assets objects will be passed to the postcss-url plugin.
* @param {Object[]} [opts.plugins] An array of PostCSS plugins to fully customise the transformation of the CSS input.
* @param {string} [opts.tag='css'] The tag used for the tagged template literal exported from the generated module.
* Use 'css' (default) with both lit-html and fast-element.
* @param {string} [opts.specifier='lit'] The import specifier used in the import declaration of the tag above. Use
* 'lit' (default) with lit-html and '@microsoft/fast-element' with fast-element.
* @returns {import('rollup').Plugin}
*/
export function litCss({
include = ['**/*.css'], exclude, minify, inline, plugins,
tag = 'css', specifier = 'lit'
Expand Down