File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed
packages/app/src/sandbox/eval/transpilers/vue/style-compiler Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -46,22 +46,25 @@ export default function(code: string, loaderContext: LoaderContext) {
4646 } ;
4747 }
4848
49- return postcss ( plugins )
50- . process ( code , options )
51- . then ( result => {
52- if ( result . messages ) {
53- result . messages . forEach ( m => {
54- if ( m . type === 'dependency' ) {
55- loaderContext . addDependency ( m . file ) ;
56- }
57- } ) ;
58- }
49+ return (
50+ postcss ( plugins )
51+ // Explcitly give undefined if code is null, otherwise postcss crashses
52+ . process ( code === null ? undefined : code , options )
53+ . then ( result => {
54+ if ( result . messages ) {
55+ result . messages . forEach ( m => {
56+ if ( m . type === 'dependency' ) {
57+ loaderContext . addDependency ( m . file ) ;
58+ }
59+ } ) ;
60+ }
5961
60- const map = result . map && result . map . toJSON ( ) ;
61- resolve ( { transpiledCode : result . css , sourceMap : map } ) ;
62+ const map = result . map && result . map . toJSON ( ) ;
63+ resolve ( { transpiledCode : result . css , sourceMap : map } ) ;
6264
63- return null ; // silence bluebird warning
64- } )
65- . catch ( err => reject ( err ) ) ;
65+ return null ; // silence bluebird warning
66+ } )
67+ . catch ( err => reject ( err ) )
68+ ) ;
6669 } ) ;
6770}
You can’t perform that action at this time.
0 commit comments