crelte 0.5.6 → 0.5.7
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/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +12 -7
- package/package.json +1 -1
- package/src/vite/index.ts +12 -6
package/dist/vite/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEN,MAAM,EAMN,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEN,MAAM,EAMN,MAAM,MAAM,CAAC;AA8Id,MAAM,MAAM,aAAa,GAAG;IAC3B,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAyK3D"}
|
package/dist/vite/index.js
CHANGED
|
@@ -22,16 +22,21 @@ function usedSsrComponents(code, id, options, svelte5) {
|
|
|
22
22
|
const file = relative('.', id);
|
|
23
23
|
let idx;
|
|
24
24
|
if (svelte5) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const initFnSign = '($$renderer, $$props) {';
|
|
28
|
-
idx = code.indexOf(initFnSign);
|
|
25
|
+
const defFnSign = 'export default function ';
|
|
26
|
+
idx = code.indexOf(defFnSign);
|
|
29
27
|
if (idx < 0)
|
|
30
28
|
return;
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const withPropsIdx = code.indexOf('($$renderer, $$props) {', idx);
|
|
30
|
+
const noPropsIdx = code.indexOf('($$renderer) {', idx);
|
|
31
|
+
idx = withPropsIdx >= 0 ? withPropsIdx : noPropsIdx;
|
|
32
|
+
if (idx < 0) {
|
|
33
|
+
console.error('could not find svelte5 init', id);
|
|
34
34
|
return;
|
|
35
|
+
}
|
|
36
|
+
const renderCompSign = '$$renderer.component(($$renderer) => {';
|
|
37
|
+
const renderCompIdx = code.indexOf(renderCompSign, idx);
|
|
38
|
+
if (renderCompIdx >= 0)
|
|
39
|
+
idx = renderCompIdx;
|
|
35
40
|
// Find the end of the line where the pattern was found
|
|
36
41
|
idx = code.indexOf('\n', idx);
|
|
37
42
|
if (idx < 0)
|
package/package.json
CHANGED
package/src/vite/index.ts
CHANGED
|
@@ -48,15 +48,21 @@ function usedSsrComponents(
|
|
|
48
48
|
|
|
49
49
|
let idx;
|
|
50
50
|
if (svelte5) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const initFnSign = '($$renderer, $$props) {';
|
|
54
|
-
idx = code.indexOf(initFnSign);
|
|
51
|
+
const defFnSign = 'export default function ';
|
|
52
|
+
idx = code.indexOf(defFnSign);
|
|
55
53
|
if (idx < 0) return;
|
|
56
54
|
|
|
55
|
+
const withPropsIdx = code.indexOf('($$renderer, $$props) {', idx);
|
|
56
|
+
const noPropsIdx = code.indexOf('($$renderer) {', idx);
|
|
57
|
+
idx = withPropsIdx >= 0 ? withPropsIdx : noPropsIdx;
|
|
58
|
+
if (idx < 0) {
|
|
59
|
+
console.error('could not find svelte5 init', id);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
const renderCompSign = '$$renderer.component(($$renderer) => {';
|
|
58
|
-
|
|
59
|
-
if (
|
|
64
|
+
const renderCompIdx = code.indexOf(renderCompSign, idx);
|
|
65
|
+
if (renderCompIdx >= 0) idx = renderCompIdx;
|
|
60
66
|
|
|
61
67
|
// Find the end of the line where the pattern was found
|
|
62
68
|
idx = code.indexOf('\n', idx);
|