@@ -68,7 +68,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
6868
6969 const component = { } ;
7070
71- const { delimiters, whitespace, moduleCache, compiledCache, getResource, addStyle, log, additionalBabelParserPlugins = [ ] , additionalBabelPlugins = { } , customBlockHandler } = options ;
71+ const { delimiters, whitespace, moduleCache, compiledCache, getResource, addStyle, log, additionalBabelParserPlugins = [ ] , additionalBabelPlugins = { } , customBlockHandler, devMode = false } = options ;
7272
7373 const descriptor = sfc_parse ( {
7474 source,
@@ -107,7 +107,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
107107 comments : true
108108 } as any ,
109109 isProduction : isProd ,
110- prettify : false
110+ prettify : devMode ,
111111 } : null ;
112112
113113 // Vue2 doesn't support preprocessCustomRequire, so we have to preprocess manually
@@ -136,7 +136,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
136136
137137 const [ depsList , transformedScriptSource ] = await withCache ( compiledCache , [ componentHash , src , additionalBabelParserPlugins , Object . keys ( additionalBabelPlugins ) ] , async ( { preventCache } ) => {
138138
139- return await transformJSCode ( src , true , strFilename , [ ...additionalBabelParserPlugins , 'jsx' ] , { ...additionalBabelPlugins , jsx, babelSugarInjectH } , log ) ;
139+ return await transformJSCode ( src , true , strFilename , [ ...additionalBabelParserPlugins , 'jsx' ] , { ...additionalBabelPlugins , jsx, babelSugarInjectH } , log , devMode ) ;
140140 } ) ;
141141
142142 await loadDeps ( filename , depsList , options ) ;
@@ -180,7 +180,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
180180 log ?.( 'info' , 'SFC template' , formatErrorStartEnd ( err . msg , strFilename , source , err . start , err . end ) ) ;
181181 }
182182
183- return await transformJSCode ( template . code , true , filename , additionalBabelParserPlugins , additionalBabelPlugins , log ) ;
183+ return await transformJSCode ( template . code , true , filename , additionalBabelParserPlugins , additionalBabelPlugins , log , devMode ) ;
184184 } ) ;
185185
186186 await loadDeps ( filename , templateDepsList , options ) ;
0 commit comments