@lvce-editor/extension-host-worker 1.4.0 → 1.4.2

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.
@@ -2405,27 +2405,17 @@ const getExtensionId = extension => {
2405
2405
  return '<unknown>';
2406
2406
  };
2407
2407
 
2408
- const getAssetDir = () => {
2409
- // @ts-ignore
2410
- if (typeof ASSET_DIR !== 'undefined') {
2411
- // @ts-ignore
2412
- return ASSET_DIR;
2413
- }
2414
- if (platform === Electron) {
2415
- return '../../../../..';
2416
- }
2417
- return '';
2418
- };
2419
- const assetDir = getAssetDir();
2420
-
2421
2408
  const getUrlPrefix = extensionPath => {
2422
2409
  if (extensionPath.startsWith('http://') || extensionPath.startsWith('https://')) {
2423
2410
  return extensionPath;
2424
2411
  }
2425
2412
  if (platform === Web) {
2426
- return `${assetDir}${extensionPath}`;
2413
+ return extensionPath;
2427
2414
  }
2428
- return `/remote${extensionPath}`;
2415
+ if (extensionPath.startsWith('/')) {
2416
+ return `/remote${extensionPath}`;
2417
+ }
2418
+ return `/remote/${extensionPath}`;
2429
2419
  };
2430
2420
 
2431
2421
  const handleRpcInfos = extension => {
@@ -2528,6 +2518,19 @@ class BabelParseError extends SyntaxError {
2528
2518
  }
2529
2519
  }
2530
2520
 
2521
+ const getAssetDir = () => {
2522
+ // @ts-ignore
2523
+ if (typeof ASSET_DIR !== 'undefined') {
2524
+ // @ts-ignore
2525
+ return ASSET_DIR;
2526
+ }
2527
+ if (platform === Electron) {
2528
+ return '../../../../..';
2529
+ }
2530
+ return '';
2531
+ };
2532
+ const assetDir = getAssetDir();
2533
+
2531
2534
  const loadBabelParser = () => {
2532
2535
  const url = `${assetDir}/js/babel-parser.js`;
2533
2536
  return import(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "main": "dist/extensionHostWorkerMain.js",
6
6
  "type": "module",