@noego/app 0.0.19 → 0.0.20

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/container.js +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noego/app",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "Production build tool for Dinner/Forge apps.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/container.js CHANGED
@@ -5,10 +5,12 @@
5
5
  * even if multiple versions of the package are loaded.
6
6
  */
7
7
 
8
+ import { createRequire } from 'node:module';
9
+
8
10
  const CONTAINER_KEY = Symbol.for('@noego/app.container');
9
11
 
10
- // Lazy-loaded container factory
11
- let _createContainer = null;
12
+ // Create require function for ES module context
13
+ const require = createRequire(import.meta.url);
12
14
 
13
15
  /**
14
16
  * Get the global IoC container instance.
@@ -18,8 +20,7 @@ let _createContainer = null;
18
20
  */
19
21
  export function getContainer() {
20
22
  if (!globalThis[CONTAINER_KEY]) {
21
- // Dynamically require @noego/ioc to avoid bundling issues
22
- // and to use the version from the user's project
23
+ // Dynamically require @noego/ioc to use the version from the user's project
23
24
  const { createContainer } = require('@noego/ioc');
24
25
  globalThis[CONTAINER_KEY] = createContainer();
25
26
  }