feat(webpack): support es module bundling (#10788)

This commit is contained in:
Nathan Walker
2025-09-18 13:03:17 -07:00
committed by GitHub
parent d6d3800884
commit 1e54baf198
20 changed files with 806 additions and 414 deletions

View File

@@ -24,15 +24,10 @@ export default function loader(content: string, map: any) {
return this.callback(null, `${content}\n${hmrRuntime}`, map);
}
const relativePath = relative(
opts.appPath ?? this.rootContext,
this.resourcePath
).replace(/\\/g, '/');
const hmrCode = this.hot
? dedent`
/* NATIVESCRIPT-HOT-LOADER */
if(module.hot && global._isModuleLoadedForUI && global._isModuleLoadedForUI("./${relativePath}")) {
if(module.hot?.accept) {
module.hot.accept()
}
`