chore(migrate): apps/* to webpack5 (#9606)

This commit is contained in:
Igor Randjelovic
2021-12-21 18:47:33 +01:00
committed by GitHub
parent 04c0f8783d
commit a88cacab89
62 changed files with 643 additions and 404 deletions

View File

@@ -78,6 +78,10 @@ async function parseXML(content: string): Promise<ParseResult> {
`${localModulePath}.xml`,
moduleName,
namespace,
`${moduleName}.xml`,
`~/${moduleName}`,
`~/${namespace}`,
`~/${moduleName}.xml`,
];
DEBUG && console.log({ resolvePaths });
let resolvedPath;
@@ -118,12 +122,13 @@ async function parseXML(content: string): Promise<ParseResult> {
this.addDependency(xml);
namespaces.push({ name: `${moduleName}.xml`, path: xml });
})
.catch(() => {
// if there is no XML file, fall back to namespace as the path
// will become require(<namespace>)
namespaces.push({ name: namespace, path: namespace });
namespaces.push({ name: moduleName, path: namespace });
});
.catch(noop);
// .catch(() => {
// // if there is no XML file, fall back to namespace as the path
// // will become require(<namespace>)
// namespaces.push({ name: namespace, path: namespace });
// namespaces.push({ name: moduleName, path: namespace });
// });
// look for css files with the same name
await resolveAsync(this.context, `${noExtFilename}.css`)
@@ -163,6 +168,8 @@ async function parseXML(content: string): Promise<ParseResult> {
distinctNamespaces.set(name, path.replace(/\\/g, '/'));
});
DEBUG && console.log({ distinctNamespaces });
distinctNamespaces.forEach((path, name) => {
moduleRegisters.push(dedent`
global.registerModule(