@lvce-editor/test-worker 11.3.0 → 11.5.0
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/dist/testWorkerMain.js +8 -6
- package/package.json +1 -1
package/dist/testWorkerMain.js
CHANGED
|
@@ -1194,9 +1194,9 @@ const clearConsole = () => {
|
|
|
1194
1194
|
console.clear();
|
|
1195
1195
|
};
|
|
1196
1196
|
|
|
1197
|
-
const createUrlWithQueryParameter = url => {
|
|
1198
|
-
const parsedUrl = new URL(url,
|
|
1199
|
-
parsedUrl.searchParams.set('time', `${
|
|
1197
|
+
const createUrlWithQueryParameter = (url, locationHref, time) => {
|
|
1198
|
+
const parsedUrl = new URL(url, locationHref);
|
|
1199
|
+
parsedUrl.searchParams.set('time', `${time}`);
|
|
1200
1200
|
const string = parsedUrl.toString();
|
|
1201
1201
|
return string;
|
|
1202
1202
|
};
|
|
@@ -4033,7 +4033,7 @@ const execute = async (href, platform, assetDir) => {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
};
|
|
4035
4035
|
|
|
4036
|
-
const hotReloadTest = async () => {
|
|
4036
|
+
const hotReloadTest = async (locationHref, time) => {
|
|
4037
4037
|
if (!hasItems()) {
|
|
4038
4038
|
return;
|
|
4039
4039
|
}
|
|
@@ -4047,13 +4047,15 @@ const hotReloadTest = async () => {
|
|
|
4047
4047
|
if (inProgress) {
|
|
4048
4048
|
return;
|
|
4049
4049
|
}
|
|
4050
|
-
const withQueryParameter = createUrlWithQueryParameter(url);
|
|
4050
|
+
const withQueryParameter = createUrlWithQueryParameter(url, locationHref, time);
|
|
4051
4051
|
clearConsole();
|
|
4052
4052
|
await execute(withQueryParameter, platform, assetDir);
|
|
4053
4053
|
};
|
|
4054
4054
|
|
|
4055
4055
|
const handleFileWatcherEvent = async event => {
|
|
4056
|
-
|
|
4056
|
+
const locationHref = location.href;
|
|
4057
|
+
const time = Date.now();
|
|
4058
|
+
await hotReloadTest(locationHref, time);
|
|
4057
4059
|
};
|
|
4058
4060
|
|
|
4059
4061
|
const commandMap = {
|