|
| 1 | +import type autoprefixer from 'autoprefixer'; |
| 2 | +import { pluginsOptions } from './plugins/plugins-options'; |
| 3 | + |
| 4 | +export type pluginOptions = { |
| 5 | + /** |
| 6 | + * Determine which CSS features to polyfill, |
| 7 | + * based upon their process in becoming web standards. |
| 8 | + * default: 2 |
| 9 | + */ |
| 10 | + stage?: number |
| 11 | + |
| 12 | + /** |
| 13 | + * Determine which CSS features to polyfill, |
| 14 | + * based their implementation status. |
| 15 | + * default: 0 |
| 16 | + */ |
| 17 | + minimumVendorImplementations?: number |
| 18 | + |
| 19 | + /** |
| 20 | + * Enable any feature that would need an extra browser library to be loaded into the page for it to work. |
| 21 | + * default: false |
| 22 | + */ |
| 23 | + enableClientSidePolyfills?: boolean |
| 24 | + |
| 25 | + /** |
| 26 | + * PostCSS Preset Env supports any standard browserslist configuration, |
| 27 | + * which can be a `.browserslistrc` file, |
| 28 | + * a `browserslist` key in `package.json`, |
| 29 | + * or `browserslist` environment variables. |
| 30 | + * |
| 31 | + * The `browsers` option should only be used when a standard browserslist configuration is not available. |
| 32 | + */ |
| 33 | + browsers?: string | readonly string[] | null |
| 34 | + |
| 35 | + /** |
| 36 | + * Determine whether all plugins should receive a `preserve` option, |
| 37 | + * which may preserve or remove the original and now polyfilled CSS. |
| 38 | + * Each plugin has it's own default, some true, others false. |
| 39 | + * default: _not set_ |
| 40 | + */ |
| 41 | + preserve?: boolean |
| 42 | + |
| 43 | + /** |
| 44 | + * [Configure autoprefixer](https://github.com/postcss/autoprefixer#options) |
| 45 | + */ |
| 46 | + autoprefixer?: autoprefixer.Options |
| 47 | + |
| 48 | + /** |
| 49 | + * Enable or disable specific polyfills by ID. |
| 50 | + * Passing `true` to a specific [feature ID](https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md) will enable its polyfill, |
| 51 | + * while passing `false` will disable it. |
| 52 | + * |
| 53 | + * Passing an object to a specific feature ID will both enable and configure it. |
| 54 | + */ |
| 55 | + features?: pluginsOptions |
| 56 | + |
| 57 | + /** |
| 58 | + * The `insertBefore` key allows you to insert other PostCSS plugins into the chain. |
| 59 | + * This is only useful if you are also using sugary PostCSS plugins that must execute before certain polyfills. |
| 60 | + * `insertBefore` supports chaining one or multiple plugins. |
| 61 | + */ |
| 62 | + insertBefore?: Record<string, unknown> |
| 63 | + |
| 64 | + /** |
| 65 | + * The `insertAfter` key allows you to insert other PostCSS plugins into the chain. |
| 66 | + * This is only useful if you are also using sugary PostCSS plugins that must execute after certain polyfills. |
| 67 | + * `insertAfter` supports chaining one or multiple plugins. |
| 68 | + */ |
| 69 | + insertAfter?: Record<string, unknown> |
| 70 | + |
| 71 | + /** |
| 72 | + * Enable debugging messages to stdout giving insights into which features have been enabled/disabled and why. |
| 73 | + * default: false |
| 74 | + */ |
| 75 | + debug?: boolean |
| 76 | +} |
0 commit comments