1
1
import { walk } from "estree-walker" ;
2
2
import { AtRule } from "postcss" ;
3
- import { addImport , findImport , getConfigExpression , setDefault } from "../../ast-tools.js" ;
3
+ import { addImport , findImport , setDefaultDefaultExport , setDefault } from "../../ast-tools.js" ;
4
4
import { extension , postcssConfigCjsPath , stylesHint } from "../postcss/stuff.js" ;
5
5
import { tailwindConfigCjsPath } from "./stuff.js" ;
6
6
@@ -9,8 +9,12 @@ import { tailwindConfigCjsPath } from "./stuff.js";
9
9
* @returns {import("../../ast-io.js").RecastAST }
10
10
*/
11
11
const updatePostcssConfig = ( postcssConfigAst ) => {
12
- const configObject = getConfigExpression ( {
12
+ const configObject = setDefaultDefaultExport ( {
13
13
cjs : true ,
14
+ defaultValue : {
15
+ type : "ObjectExpression" ,
16
+ properties : [ ] ,
17
+ } ,
14
18
typeScriptEstree : postcssConfigAst ,
15
19
} ) ;
16
20
@@ -134,8 +138,12 @@ const updatePostcssConfig = (postcssConfigAst) => {
134
138
* @returns {import("../../ast-io.js").RecastAST }
135
139
*/
136
140
const updateTailwindConfig = ( tailwindConfigAst , forms , typography ) => {
137
- const configObject = getConfigExpression ( {
141
+ const configObject = setDefaultDefaultExport ( {
138
142
cjs : true ,
143
+ defaultValue : {
144
+ type : "ObjectExpression" ,
145
+ properties : [ ] ,
146
+ } ,
139
147
typeScriptEstree : tailwindConfigAst ,
140
148
} ) ;
141
149
0 commit comments