@ecopages/core 0.2.0-alpha.40 → 0.2.0-alpha.42
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/core",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.42",
|
|
4
4
|
"description": "Core package for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"directory": "packages/core"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ecopages/file-system": "0.2.0-alpha.
|
|
20
|
+
"@ecopages/file-system": "0.2.0-alpha.42",
|
|
21
21
|
"@ecopages/logger": "^0.2.3",
|
|
22
22
|
"@ecopages/scripts-injector": "^0.1.5",
|
|
23
23
|
"@worker-tools/html-rewriter": "0.1.0-pre.19",
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
"types": "./src/hmr/hmr-strategy.d.ts",
|
|
84
84
|
"default": "./src/hmr/hmr-strategy.js"
|
|
85
85
|
},
|
|
86
|
+
"./hmr/client/hmr-runtime": {
|
|
87
|
+
"types": "./src/hmr/client/hmr-runtime.d.ts",
|
|
88
|
+
"default": "./src/hmr/client/hmr-runtime.js"
|
|
89
|
+
},
|
|
86
90
|
"./dev/host-runtime": {
|
|
87
91
|
"types": "./src/dev/host-runtime.d.ts",
|
|
88
92
|
"default": "./src/dev/host-runtime.js"
|
|
@@ -190,6 +194,10 @@
|
|
|
190
194
|
"types": "./src/hmr/hmr-strategy.d.ts",
|
|
191
195
|
"default": "./src/hmr/hmr-strategy.js"
|
|
192
196
|
},
|
|
197
|
+
"./hmr/client/hmr-runtime.ts": {
|
|
198
|
+
"types": "./src/hmr/client/hmr-runtime.d.ts",
|
|
199
|
+
"default": "./src/hmr/client/hmr-runtime.js"
|
|
200
|
+
},
|
|
193
201
|
"./dev/host-runtime.ts": {
|
|
194
202
|
"types": "./src/dev/host-runtime.d.ts",
|
|
195
203
|
"default": "./src/dev/host-runtime.js"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { RESOLVED_ASSETS_DIR } from "../../config/constants.js";
|
|
4
5
|
import { getAppBuildExecutor } from "../../build/build-adapter.js";
|
|
5
6
|
import { fileSystem } from "@ecopages/file-system";
|
|
@@ -100,7 +101,7 @@ class SharedHmrManager {
|
|
|
100
101
|
return this.enabled;
|
|
101
102
|
}
|
|
102
103
|
async buildRuntime() {
|
|
103
|
-
const runtimeSource =
|
|
104
|
+
const runtimeSource = fileURLToPath(import.meta.resolve("@ecopages/core/hmr/client/hmr-runtime"));
|
|
104
105
|
try {
|
|
105
106
|
const result = await this.browserBundleService.bundle({
|
|
106
107
|
profile: "hmr-runtime",
|
|
@@ -333,7 +333,12 @@ class RouteRenderOrchestrator {
|
|
|
333
333
|
return integrationNames;
|
|
334
334
|
}
|
|
335
335
|
async buildGlobalInjectorAssets(triggers, currentIntegrationName) {
|
|
336
|
-
const
|
|
336
|
+
const appProjectDir = this.appConfig.rootDir ?? this.appConfig.absolutePaths?.projectDir ?? process.cwd();
|
|
337
|
+
const appPackageRequire = createRequire(path.join(appProjectDir, "package.json"));
|
|
338
|
+
const corePackageEntryPath = appPackageRequire.resolve("@ecopages/core");
|
|
339
|
+
const globalInjectorImportPath = createRequire(corePackageEntryPath).resolve(
|
|
340
|
+
"@ecopages/scripts-injector/global"
|
|
341
|
+
);
|
|
337
342
|
const mapScript = AssetFactory.createInlineContentScript({
|
|
338
343
|
position: "head",
|
|
339
344
|
name: "ecopages-global-injector-map",
|