Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 3f1ee07

Browse files
committed
fix(runtime-vapor): swc minify error
1 parent c065aaf commit 3f1ee07

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

benchmark/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ async function buildLib() {
9292
cwd: path.resolve(import.meta.dirname, '..'),
9393
stdio: 'inherit',
9494
}
95-
const BuildOptions = devBuild ? '-df' : '-pf'
95+
const buildOptions = devBuild ? '-df' : '-pf'
9696
const [{ ok }, { ok: ok2 }, { ok: ok3 }, { ok: ok4 }] = await Promise.all([
9797
exec(
9898
'pnpm',
99-
`run --silent build shared compiler-core compiler-dom compiler-vapor ${BuildOptions} cjs`.split(
99+
`run --silent build shared compiler-core compiler-dom compiler-vapor ${buildOptions} cjs`.split(
100100
' ',
101101
),
102102
options,
@@ -108,12 +108,12 @@ async function buildLib() {
108108
),
109109
exec(
110110
'pnpm',
111-
`run --silent build vue-vapor ${BuildOptions} esm-browser`.split(' '),
111+
`run --silent build vue-vapor ${buildOptions} esm-browser`.split(' '),
112112
options,
113113
),
114114
exec(
115115
'pnpm',
116-
`run --silent build vue ${BuildOptions} esm-browser-runtime`.split(' '),
116+
`run --silent build vue ${buildOptions} esm-browser-runtime`.split(' '),
117117
options,
118118
),
119119
])

benchmark/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start": "node index.js"
1010
},
1111
"dependencies": {
12-
"@vitejs/plugin-vue": "npm:@vue-vapor/vite-plugin-vue@0.0.0-alpha.6",
12+
"@vitejs/plugin-vue": "https://pkg.pr.new/@vitejs/plugin-vue@vapor",
1313
"connect": "^3.7.0",
1414
"sirv": "^2.0.4",
1515
"vite": "^5.0.12"

packages/runtime-vapor/src/dom/element.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,21 @@ export function insert(
2525
parent: ParentNode,
2626
anchor: Node | null = null,
2727
): void {
28-
normalizeBlock(block).forEach(node => parent.insertBefore(node, anchor))
28+
const nodes = normalizeBlock(block)
29+
for (let i = 0; i < nodes.length; i++) {
30+
parent.insertBefore(nodes[i], anchor)
31+
}
2932
}
3033

3134
export function prepend(parent: ParentNode, ...blocks: Block[]): void {
3235
parent.prepend(...normalizeBlock(blocks))
3336
}
3437

3538
export function remove(block: Block, parent: ParentNode): void {
36-
normalizeBlock(block).forEach(node => parent.removeChild(node))
39+
const nodes = normalizeBlock(block)
40+
for (let i = 0; i < nodes.length; i++) {
41+
parent.removeChild(nodes[i])
42+
}
3743
}
3844

3945
export function createTextNode(values?: any[] | (() => any[])): Text {

pnpm-lock.yaml

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)