1 | const postcssPresetEnv = require('postcss-preset-env')
|
2 | const postcssImport = require('postcss-import')
|
3 | const cssnano = require('cssnano')
|
4 | const combineSelectors = require('postcss-combine-duplicated-selectors')
|
5 |
|
6 | const lib = process.env.npm_lifecycle_event
|
7 |
|
8 | const inlineMediaQueries = lib === 'lib:media' || lib === 'lib:supports'
|
9 | // todo: inline MQs for 'lib:all' when it's supported better
|
10 |
|
11 | module.exports = {
|
12 | plugins: [
|
13 | postcssImport(),
|
14 | postcssPresetEnv({
|
15 | stage: 0,
|
16 | autoprefixer: false,
|
17 | features: {
|
18 | 'logical-properties-and-values': false,
|
19 | 'prefers-color-scheme-query': false,
|
20 | 'gap-properties': false,
|
21 | 'custom-properties': false,
|
22 | 'place-properties': false,
|
23 | 'not-pseudo-class': false,
|
24 | 'focus-visible-pseudo-class': false,
|
25 | 'focus-within-pseudo-class': false,
|
26 | 'color-functional-notation': false,
|
27 | 'custom-media-queries': {preserve:inlineMediaQueries},
|
28 | 'double-position-gradients': false,
|
29 | }
|
30 | }),
|
31 | combineSelectors(),
|
32 | cssnano({
|
33 | preset: 'default'
|
34 | }),
|
35 | ]
|
36 | }
|