Skip to content

Commit a790629

Browse files
committed
Pass in shallow copy of parse options when re-parsing at-rule params
1 parent 7289930 commit a790629

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,12 @@ function transformCss(ast: any, { env }: TransformerContext) {
735735
// based on postcss-value parser.
736736
try {
737737
let parser = base.parsers.css
738-
let root = parser.parse(`@import ${params};`, env.options)
738+
739+
let root = parser.parse(`@import ${params};`, {
740+
// We can't pass env.options directly because css.parse overwrites
741+
// options.originalText which is used during the printing phase
742+
...env.options,
743+
})
739744

740745
return root.nodes[0].params
741746
} catch (err) {

0 commit comments

Comments
 (0)