File tree 3 files changed +21
-0
lines changed
3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,10 @@ function css(css, file) {
206
206
)
207
207
}
208
208
209
+ if ( ! options . parser && ! options . syntax && ! options . stringifier ) {
210
+ options . syntax = require ( 'postcss-syntax' )
211
+ }
212
+
209
213
return postcss ( config . plugins )
210
214
. process ( css , options )
211
215
. then ( result => {
Original file line number Diff line number Diff line change 27
27
"postcss" : " ^7.0.0" ,
28
28
"postcss-load-config" : " ^2.0.0" ,
29
29
"postcss-reporter" : " ^5.0.0" ,
30
+ "postcss-syntax" : " ^0.32.0" ,
30
31
"pretty-hrtime" : " ^1.0.3" ,
31
32
"read-cache" : " ^1.0.0" ,
32
33
"yargs" : " ^12.0.1"
Original file line number Diff line number Diff line change @@ -20,3 +20,19 @@ test('--syntax works', async t => {
20
20
21
21
t . is ( await read ( output ) , await read ( 'test/fixtures/a.sss' ) )
22
22
} )
23
+
24
+ test ( 'automatically switch syntax' , async t => {
25
+ const dir = tmp ( )
26
+
27
+ const { error, stderr } = await cli ( [
28
+ 'test/fixtures/b.*' ,
29
+ '-d' ,
30
+ dir ,
31
+ '--no-map'
32
+ ] )
33
+
34
+ t . ifError ( error , stderr )
35
+
36
+ t . is ( await read ( `${ dir } /b.sss` ) , await read ( 'test/fixtures/b.sss' ) )
37
+ t . is ( await read ( `${ dir } /b.css` ) , await read ( 'test/fixtures/b.css' ) )
38
+ } )
You can’t perform that action at this time.
0 commit comments