@jitar/plugin-vite 0.4.2 → 0.5.1
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/index.js +3 -4
- package/package.json +10 -4
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ function createServerConfig(jitarUrl) {
|
|
|
28
28
|
}
|
|
29
29
|
function createBootstrapCode(segments) {
|
|
30
30
|
const segmentString = segments.map(segment => `'${segment}'`).join(', ');
|
|
31
|
-
return `<script type="module">const jitar = await import(
|
|
31
|
+
return `<script type="module">const jitar = await import("/jitar/client.js"); await jitar.startClient(document.location.origin, [${segmentString}]);</script>`;
|
|
32
32
|
}
|
|
33
33
|
async function createImportCode(code, id, jitarFullPath, jitarPath) {
|
|
34
34
|
const relativeId = id
|
|
@@ -48,9 +48,8 @@ async function createImportCode(code, id, jitarFullPath, jitarPath) {
|
|
|
48
48
|
importCode += functionKeys.map(key => `const ${key} = module.${key};`).join('\n');
|
|
49
49
|
exportCode += `export { ${functionKeys.join(', ')} };\n`;
|
|
50
50
|
}
|
|
51
|
-
return '
|
|
52
|
-
+
|
|
53
|
-
+ `const module = await client.import('./${jitarPath}${relativeId}');\n`
|
|
51
|
+
return 'import { getClient } from "/jitar/client.js";\n'
|
|
52
|
+
+ `const module = await (await getClient()).import("./${jitarPath}${relativeId}");\n`
|
|
54
53
|
+ importCode
|
|
55
54
|
+ exportCode;
|
|
56
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jitar/plugin-vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Vite plugin for Jitar.",
|
|
5
5
|
"author": "Masking Technology <info@masking.tech> (https://jitar.dev)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,10 +27,15 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@jitar/reflection": "^0.
|
|
30
|
+
"@jitar/reflection": "^0.5.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"vite": "
|
|
33
|
+
"vite": ">=4.0.0 || >=5.0.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependenciesMeta": {
|
|
36
|
+
"vite": {
|
|
37
|
+
"optional": true
|
|
38
|
+
}
|
|
34
39
|
},
|
|
35
40
|
"repository": {
|
|
36
41
|
"type": "git",
|
|
@@ -42,7 +47,8 @@
|
|
|
42
47
|
"homepage": "https://jitar.dev",
|
|
43
48
|
"keywords": [
|
|
44
49
|
"vite",
|
|
50
|
+
"vite-plugin",
|
|
45
51
|
"jitar"
|
|
46
52
|
],
|
|
47
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "3de05448831f9df7b0b768f03edc9aff65209f15"
|
|
48
54
|
}
|