Skip to content

Commit 274c10e

Browse files
authored
fix(css): support postcss.config.ts (#7935)
1 parent 7f535ac commit 274c10e

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

packages/playground/tailwind/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"vue-router": "^4.0.0"
1616
},
1717
"devDependencies": {
18-
"@vitejs/plugin-vue": "workspace:*"
18+
"@vitejs/plugin-vue": "workspace:*",
19+
"ts-node": "^10.4.0"
1920
}
2021
}

packages/playground/tailwind/postcss.config.js packages/playground/tailwind/postcss.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// postcss.config.js
1+
// postcss.config.ts
22
module.exports = {
33
plugins: {
44
tailwindcss: { config: __dirname + '/tailwind.config.js' },

packages/vite/rollup.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ const createNodeConfig = (isProduction) => {
171171
'lilconfig/dist/index.js': {
172172
pattern: /: require,/g,
173173
replacement: `: eval('require'),`
174+
},
175+
// postcss-load-config calls require after register ts-node
176+
'postcss-load-config/src/index.js': {
177+
src: `require(configFile)`,
178+
replacement: `eval('require')(configFile)`
174179
}
175180
}),
176181
commonjs({

pnpm-lock.yaml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)