@jitar/plugin-vite 0.8.2 → 0.9.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 +6 -5
- package/package.json +7 -4
package/dist/index.js
CHANGED
|
@@ -20,9 +20,6 @@ function assureExtension(filename) {
|
|
|
20
20
|
}
|
|
21
21
|
return `${filename}.js`;
|
|
22
22
|
}
|
|
23
|
-
function makeShared(filename) {
|
|
24
|
-
return assureExtension(filename).replace('.js', '.shared.js');
|
|
25
|
-
}
|
|
26
23
|
export default function viteJitar(pluginConfig) {
|
|
27
24
|
const sourceDir = formatDir(pluginConfig.sourceDir);
|
|
28
25
|
const targetDir = formatDir(pluginConfig.targetDir);
|
|
@@ -30,7 +27,7 @@ export default function viteJitar(pluginConfig) {
|
|
|
30
27
|
const jitarUrl = pluginConfig.jitarUrl;
|
|
31
28
|
const segments = pluginConfig.segments ?? [];
|
|
32
29
|
const middlewares = pluginConfig.middleware ?? [];
|
|
33
|
-
const scopes = [
|
|
30
|
+
const scopes = [...segments, 'remote'];
|
|
34
31
|
let rootPath;
|
|
35
32
|
let sourcePath;
|
|
36
33
|
let targetPath;
|
|
@@ -91,6 +88,10 @@ export default function viteJitar(pluginConfig) {
|
|
|
91
88
|
return scopeId;
|
|
92
89
|
}
|
|
93
90
|
}
|
|
91
|
+
const scopeId = cacheId.replace('.ts', '.js');
|
|
92
|
+
if (fs.existsSync(scopeId)) {
|
|
93
|
+
return scopeId;
|
|
94
|
+
}
|
|
94
95
|
return resolution.id;
|
|
95
96
|
}
|
|
96
97
|
},
|
|
@@ -99,7 +100,7 @@ export default function viteJitar(pluginConfig) {
|
|
|
99
100
|
return null;
|
|
100
101
|
}
|
|
101
102
|
const segmentFiles = segments.map(name => `${targetPath}/${name}.segment.js`);
|
|
102
|
-
const middlewareFiles = middlewares.map(name =>
|
|
103
|
+
const middlewareFiles = middlewares.map(name => assureExtension(`${targetPath}/${name}`));
|
|
103
104
|
const jitarImport = `import { ClientBuilder, HttpRemoteBuilder } from "${JITAR_CLIENT_ID}";`;
|
|
104
105
|
const segmentImports = segmentFiles.map((filename, index) => `import { default as $S${index} } from "${filename}";`).join('');
|
|
105
106
|
const middlewareImports = middlewareFiles.map((filename, index) => `import { default as $M${index} } from "${filename}";`).join('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jitar/plugin-vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Vite plugin for Jitar.",
|
|
5
5
|
"author": "Masking Technology <info@masking.tech> (https://jitar.dev)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,15 +19,18 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "tsc -p tsconfig.json",
|
|
22
|
-
"lint": "eslint
|
|
22
|
+
"lint": "eslint",
|
|
23
23
|
"clean": "rm -rf dist build",
|
|
24
24
|
"prepublishOnly": "npm run clean && npm run build"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"vite": "^6.0.11"
|
|
31
|
+
},
|
|
29
32
|
"peerDependencies": {
|
|
30
|
-
"vite": ">=4.0.0 || >=5.0.0"
|
|
33
|
+
"vite": ">=4.0.0 || >=5.0.0 || >=6.0.0"
|
|
31
34
|
},
|
|
32
35
|
"peerDependenciesMeta": {
|
|
33
36
|
"vite": {
|
|
@@ -47,5 +50,5 @@
|
|
|
47
50
|
"vite-plugin",
|
|
48
51
|
"jitar"
|
|
49
52
|
],
|
|
50
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "3e4dcf529f258336521b4ce3a4db2faa94d67ea1"
|
|
51
54
|
}
|