@@ -63,11 +63,7 @@ function scriptParser(scriptObject: ScriptObjectType, defaults: Object, type: st
6363 const cachedBabelScript = Cache . get ( cacheKey ) ;
6464 if ( cachedBabelScript ) {
6565 const finalScript = dataMerge ( cachedBabelScript , defaults , type ) ;
66- const finalObject = {
67- script : finalScript ,
68- style : cachedBabelScript . style
69- } ;
70- resolve ( finalObject ) ;
66+ resolve ( finalScript ) ;
7167 } else {
7268 const babelScript = babel . transform ( scriptObject . content , options ) ;
7369 // const filename = path.join(defaults.rootPath, '/', defaults.component);
@@ -76,16 +72,12 @@ function scriptParser(scriptObject: ScriptObjectType, defaults: Object, type: st
7672 defaults : defaults
7773 } ;
7874 Utils . requireFromString ( babelScript . code , defaults . component , requireFromStringOptions , Cache )
79- . then ( requiredObject => {
75+ . then ( scriptFromString => {
8076 // set the cache for the babel script string
81- Cache . set ( cacheKey , requiredObject ) ;
77+ Cache . set ( cacheKey , scriptFromString ) ;
8278
83- const finalScript = dataMerge ( requiredObject . code , defaults , type ) ;
84- const finalObject = {
85- script : finalScript ,
86- style : requiredObject . style
87- } ;
88- resolve ( finalObject ) ;
79+ const finalScript = dataMerge ( scriptFromString , defaults , type ) ;
80+ resolve ( finalScript ) ;
8981 } )
9082 . catch ( error => reject ( error ) ) ;
9183 }
0 commit comments