Skip to content

Commit

Permalink
Add missing js modules for dojo styles (#4548)
Browse files Browse the repository at this point in the history
  • Loading branch information
maier49 committed Jul 15, 2020
1 parent 36f7974 commit 4a4a2c3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/app/src/sandbox/eval/presets/dojo/transpilers/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,20 @@ class DojoStyleTranspiler extends StyleTranspiler {
async doTranspilation(code: string, loaderContext: LoaderContext) {
const id = getStyleId(loaderContext._module.getId());
const { path } = loaderContext;
const modules = loaderContext.getModules();
let modules = loaderContext.getModules();
let result = modules.find(module => module.path === `${path}.js`);

if (!result && path.indexOf('/node_modules/') > -1) {
try {
await loaderContext.resolveTranspiledModuleAsync(`${path}.js`, {
ignoredExtensions: [],
});
} catch {
// Do nothing
}
}
modules = loaderContext.getModules();
result = modules.find(module => module.path === `${path}.js`);
if (result) {
return { transpiledCode: `${insertCss(id, code)}\n${result.code}` };
}
Expand Down

0 comments on commit 4a4a2c3

Please sign in to comment.