File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/app/src/sandbox/eval/presets/dojo/transpilers Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,17 @@ class DojoStyleTranspiler extends StyleTranspiler {
1212 async doTranspilation ( code : string , loaderContext : LoaderContext ) {
1313 const id = getStyleId ( loaderContext . _module . getId ( ) ) ;
1414 const { path } = loaderContext ;
15- const { code : packageJson } = loaderContext
16- . getModules ( )
17- . find ( module => module . path === '/package.json' ) ;
15+ const modules = loaderContext . getModules ( ) ;
16+ let result = modules . find ( module => module . path === `${ path } .js` ) ;
17+ if ( result ) {
18+ return { transpiledCode : `${ insertCss ( id , code ) } \n${ result . code } ` } ;
19+ }
20+ const { code : packageJson } = modules . find ( module => module . path === '/package.json' ) ;
1821 const { name : packageName } = JSON . parse ( packageJson ) ;
1922 const [ , baseName ] = / \/ ( [ ^ / . ] * ) [ ^ / ] * $ / . exec ( path ) ;
2023 const key = `${ packageName } /${ baseName } ` ;
2124 const { css, exportTokens } = await getModules ( code , loaderContext ) ;
22- let result = insertCss ( id , css ) ;
25+ result = insertCss ( id , css ) ;
2326 result += `\nmodule.exports=${ JSON . stringify ( {
2427 ' _key' : key ,
2528 ...exportTokens ,
You can’t perform that action at this time.
0 commit comments