This repository has been archived by the owner on Jul 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostcss.config.cjs
62 lines (59 loc) · 1.59 KB
/
postcss.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* eslint-disable @typescript-eslint/no-var-requires */
/**
* @file PostCSS Configuration
* @see https://github.com/postcss/postcss
* @type {import('postcss').AcceptedPlugin}
*/
const htmlPlugin = require('postcss-html')
const scssPlugin = require('postcss-scss')
const jitProps = require('postcss-jit-props')
const openProps = require('open-props')
const lightingCSS = require('postcss-lightningcss')
const nodeConfig = require('./package.json')
// const purgeCSS = require('@fullhuman/postcss-purgecss')
const mode = process.env.NODE_ENV
const dev = mode === 'development'
const purgeSafelist = {
/* https://github.com/juzerzarif/juzerzarif.com/blob/main/postcss.config.cjs */
standard: [
/^(?!.*animate__[a-zA-Z]+).*/,
],
greedy: [
/:lang$/,
],
}
const config = {
syntax: htmlPlugin({
scss: scssPlugin,
}),
parser: scssPlugin,
plugins: [
jitProps(openProps),
/* https://github.com/onigoetz/postcss-lightningcss */
lightingCSS({
browsers: nodeConfig.browserslist,
lightningcssOptions: {
minify: process.env.MODE === 'production' ? true : false, // (!dev ? true : false),
sourceMap: true,
cssModules: false,
import: false,
/* https://preset-env.cssdb.org/features */
// drafts: {},
},
}),
// purgeCSS({
// content: [
// './src/**/*.{js,ts,svelte,svx,md}',
// './content/**/*.{md,svx}',
// './static/**/*.{html,svg}'
// ],
// css: [
// './src/styles/**/*.{css,scss,pcss}',
// ],
// defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
// safelist: purgeSafelist,
// keyframes: true,
// }),
],
}
module.exports = config