mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore(migrate): apps/* to webpack5 (#9606)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user