File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff line change @@ -46,7 +46,20 @@ let css: TestEntry[] = [
4646 [ `@config "./file.js";` , `@config './file.js';` ] ,
4747 [ `@source "./file.js";` , `@source './file.js';` ] ,
4848 [ `@source not "./file.js";` , `@source not './file.js';` ] ,
49- [ `@source inline("./file.js");` , `@source inline('./file.js');` ] ,
49+ [ `@source inline("flex");` , `@source inline('flex');` ] ,
50+
51+ [
52+ `@import "tailwindcss";\n\n@import "./theme.css";\n\n@source "./file.js";\n\n.foo {\n color: red;\n}` ,
53+ `@import 'tailwindcss';\n\n@import './theme.css';\n\n@source './file.js';\n\n.foo {\n color: red;\n}` ,
54+ ] ,
55+ [
56+ `@import "tailwindcss";\n\n@import "./theme.css";\n\n@plugin "./file.js";\n\n.foo {\n color: red;\n}` ,
57+ `@import 'tailwindcss';\n\n@import './theme.css';\n\n@plugin './file.js';\n\n.foo {\n color: red;\n}` ,
58+ ] ,
59+ [
60+ `@import "tailwindcss";\n\n@import "./theme.css";\n\n@config "./file.js";\n\n.foo {\n color: red;\n}` ,
61+ `@import 'tailwindcss';\n\n@import './theme.css';\n\n@config './file.js';\n\n.foo {\n color: red;\n}` ,
62+ ] ,
5063]
5164
5265export let javascript : TestEntry [ ] = [
You can’t perform that action at this time.
0 commit comments