Skip to content

Commit 22275d2

Browse files
committedApr 11, 2025
build: splits postcss into two processes because the color-function is dependant on the other having already been processed
1 parent be32b1c commit 22275d2

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed
 

‎packages/uui-css/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
},
3535
"scripts": {
3636
"build": "npm run build:cssprops && tsc --build && rollup -c rollup.config.js",
37-
"build:cssprops": "postcss lib/custom-properties.css --base lib/ --dir dist && npm run custom-properties-cache",
37+
"build:cssprops": "npm run postcss:convert && npm run postcss:colors && npm run custom-properties-cache",
38+
"postcss:convert": "postcss lib/custom-properties.css -o dist/custom-properties.css",
39+
"postcss:colors": "postcss dist/custom-properties.css -u postcss-color-function -o dist/custom-properties.css",
3840
"clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js *.tgz lib/**/*.d.ts custom-elements.json custom-properties.*",
3941
"analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json",
4042
"custom-properties-cache": "node ./scripts/update-custom-properties-cache.js"

‎packages/uui-css/postcss.config.cjs

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
module.exports = () => {
2-
return {
3-
plugins: {
4-
'postcss-advanced-variables': {},
5-
'postcss-color-function': {},
6-
'postcss-url': {},
7-
autoprefixer: {},
8-
},
9-
};
1+
/** @type {import('postcss-load-config').Config} */
2+
const config = {
3+
plugins: [
4+
require('postcss-advanced-variables'),
5+
require('postcss-color-function'),
6+
require('postcss-url'),
7+
require('autoprefixer'),
8+
],
109
};
10+
11+
module.exports = config;

0 commit comments

Comments
 (0)
Please sign in to comment.