1
1
import { NPM_PLUGIN_ASSETS_BASE_URL } from "constants/npmPlugins" ;
2
2
import { trans } from "i18n" ;
3
3
import { CompConstructor } from "lowcoder-core" ;
4
- import { RemoteCompInfo , RemoteCompLoader , RemoteCompSource } from "types/remoteComp" ;
4
+ import {
5
+ RemoteCompInfo ,
6
+ RemoteCompLoader ,
7
+ RemoteCompSource ,
8
+ } from "types/remoteComp" ;
5
9
6
- async function npmLoader ( remoteInfo : RemoteCompInfo ) : Promise < CompConstructor | null > {
10
+ async function npmLoader (
11
+ remoteInfo : RemoteCompInfo
12
+ ) : Promise < CompConstructor | null > {
7
13
const { packageName, packageVersion = "latest" , compName } = remoteInfo ;
8
14
const entry = `${ NPM_PLUGIN_ASSETS_BASE_URL } /${ packageName } @${ packageVersion } /index.js` ;
15
+ // const entry = `../../../../../public/package/index.js`;
9
16
// console.log("Entry", entry);
10
17
try {
11
18
const module = await import ( /* webpackIgnore: true */ entry ) ;
@@ -21,7 +28,9 @@ async function npmLoader(remoteInfo: RemoteCompInfo): Promise<CompConstructor |
21
28
}
22
29
}
23
30
24
- async function bundleLoader ( remoteInfo : RemoteCompInfo ) : Promise < CompConstructor | null > {
31
+ async function bundleLoader (
32
+ remoteInfo : RemoteCompInfo
33
+ ) : Promise < CompConstructor | null > {
25
34
const { packageName, packageVersion = "latest" , compName } = remoteInfo ;
26
35
const entry = `/${ packageName } /${ packageVersion } /index.js?v=${ REACT_APP_COMMIT_ID } ` ;
27
36
const module = await import ( /* webpackIgnore: true */ entry ) ;
0 commit comments