@dcoder-x/vite 0.1.3 → 0.1.4
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/ClippyVitePlugin.js +3 -2
- package/package.json +2 -2
package/dist/ClippyVitePlugin.js
CHANGED
|
@@ -5,7 +5,7 @@ import { FlowInferrer } from '@dcoder-x/plugin-shared/extractors/FlowInferrer';
|
|
|
5
5
|
import { PackageBuilder } from '@dcoder-x/plugin-shared/upload/PackageBuilder';
|
|
6
6
|
import { PackageWriter } from '@dcoder-x/plugin-shared/upload/PackageWriter';
|
|
7
7
|
import { Uploader } from '@dcoder-x/plugin-shared/upload/Uploader';
|
|
8
|
-
import { injectClippyIds, deriveBuildId, performUpload } from '@dcoder-x/plugin-shared';
|
|
8
|
+
import { injectClippyIds, deriveBuildId, performUpload, inferRouteFromFilePath } from '@dcoder-x/plugin-shared';
|
|
9
9
|
export function clippyVitePlugin(options) {
|
|
10
10
|
const moduleGraph = new Map();
|
|
11
11
|
const injectedMap = new Map();
|
|
@@ -24,7 +24,8 @@ export function clippyVitePlugin(options) {
|
|
|
24
24
|
const cleanId = id.split('?')[0];
|
|
25
25
|
if (!/\.[jt]sx?$/.test(cleanId))
|
|
26
26
|
return null;
|
|
27
|
-
const
|
|
27
|
+
const routePath = inferRouteFromFilePath(cleanId) ?? undefined;
|
|
28
|
+
const result = injectClippyIds(source, cleanId, routePath);
|
|
28
29
|
if (result.injectedCount === 0)
|
|
29
30
|
return null;
|
|
30
31
|
if (result.injected && result.injected.length)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcoder-x/vite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dcoder-x/plugin-shared": "^0.1.
|
|
21
|
+
"@dcoder-x/plugin-shared": "^0.1.5"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"vite": ">=4.0.0",
|