@nativescript/angular 21.0.1-alpha.5 → 21.0.1-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7447,13 +7447,20 @@ const DEFAULT_INVALIDATE_EVENT = 'ns:cache-invalidate';
7447
7447
  * type is the only one in play; `vite/client`-aware apps still get
7448
7448
  * their own typing on `import.meta.hot` at every call site outside
7449
7449
  * this module.
7450
+ *
7451
+ * Webpack-CommonJS compatibility: every `import.meta` reference here
7452
+ * is a member expression (`import.meta['hot']`). Webpack statically
7453
+ * rewrites both dot- and bracket-style member access to `undefined`
7454
+ * in CommonJS output, so the emitted bundle never carries a literal
7455
+ * bare `import.meta` token. A bare `import.meta` would survive into
7456
+ * the bundle and crash V8 with "Cannot use 'import.meta' outside a
7457
+ * module" the moment the chunk is `require()`d. Vite leaves
7458
+ * `import.meta['hot']` intact and resolves it to the per-module hot
7459
+ * context, so the same code works in both pipelines.
7450
7460
  */
7451
7461
  function readImportMetaHot() {
7452
7462
  try {
7453
- const meta = typeof import.meta !== 'undefined'
7454
- ? import.meta
7455
- : undefined;
7456
- return meta?.hot;
7463
+ return import.meta['hot'];
7457
7464
  }
7458
7465
  catch {
7459
7466
  return undefined;
@@ -7879,10 +7886,12 @@ function getOrCreateSharedStore() {
7879
7886
  }
7880
7887
  function hasImportMetaHot() {
7881
7888
  try {
7882
- const meta = typeof import.meta !== 'undefined'
7883
- ? import.meta
7884
- : undefined;
7885
- return !!meta?.hot;
7889
+ // Member-expression access only — webpack rewrites `import.meta['hot']`
7890
+ // to `undefined` in CommonJS bundles (so `!!undefined` → `false`),
7891
+ // while Vite leaves it as the per-module hot context. A bare
7892
+ // `typeof import.meta` would survive into the bundle and crash V8
7893
+ // with "Cannot use 'import.meta' outside a module" on `require()`.
7894
+ return !!import.meta['hot'];
7886
7895
  }
7887
7896
  catch {
7888
7897
  return false;