-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostcss.config.js
More file actions
41 lines (40 loc) · 1.16 KB
/
Copy pathpostcss.config.js
File metadata and controls
41 lines (40 loc) · 1.16 KB
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
const path = require('path');
module.exports = {
plugins: {
// Expand @mixin / @define-mixin BEFORE other transforms so that
// the emitted selectors are processed by nesting-rules, autoprefixer, etc.
'postcss-mixins': {
mixinsFiles: [path.join(__dirname, 'src/styles/postcss-mixins.css')],
},
// Ensure consistent CSS processing across environments
'postcss-preset-env': {
stage: 1, // Enable modern CSS features
autoprefixer: {
grid: true, // Enable CSS Grid autoprefixing
},
features: {
'custom-properties': {
preserve: true, // Preserve CSS custom properties for runtime theming
},
'nesting-rules': true, // Enable CSS nesting
},
},
// CSS minification with consistent settings
cssnano: process.env.NODE_ENV === 'production' ? {
preset: [
'default',
{
discardComments: {
removeAll: true,
},
normalizeWhitespace: true,
colormin: true,
convertValues: true,
reduceInitial: true,
reduceTransforms: true,
svgo: true,
},
],
} : false,
},
};