Skip to content

Commit 67ecbc8

Browse files
committed
refactor: remove runtime load hooks
1 parent ab490e2 commit 67ecbc8

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

packages/babel/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default (): {
108108
statements.unshift(
109109
`import { ${helpers
110110
.map((i) => `${i} as _${i}`)
111-
.join(', ')} } from 'vue-jsx-vapor/runtime';\n`,
111+
.join(', ')} } from 'vue-jsx-vapor';\n`,
112112
)
113113
}
114114

packages/babel/test/__snapshots__/transform.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`transform > transform multiple components 1`] = `
44
"import { child as _child, delegateEvents as _delegateEvents, template as _template, createIf as _createIf } from 'vue';
5-
import { setNodes as _setNodes } from 'vue-jsx-vapor/runtime';
5+
import { setNodes as _setNodes } from 'vue-jsx-vapor';
66
const t0 = _template("<div> </div>", true),
77
t1 = _template("<div>Hello</div>"),
88
t2 = _template("<div>World</div>");

packages/vue-jsx-vapor/src/raw.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import macros from '@vue-jsx-vapor/macros/raw'
22
import { transformJsxDirective } from '@vue-macros/jsx-directive/api'
3-
import { createFilter, normalizePath } from 'unplugin-utils'
3+
import { createFilter } from 'unplugin-utils'
44
import { transformVueJsxVapor } from './core'
55
import { injectHMRAndSSR } from './core/hmr'
6-
import runtimeCode from './core/runtime?raw'
76
import { ssrRegisterHelperCode, ssrRegisterHelperId } from './core/ssr'
87
import { transformVueJsx } from './core/vue-jsx'
98
import type { Options } from './options'
@@ -46,15 +45,12 @@ const plugin = (options: Options = {}): UnpluginOptions[] => {
4645
},
4746
resolveId(id) {
4847
if (id === ssrRegisterHelperId) return id
49-
if (normalizePath(id) === 'vue-jsx-vapor/runtime') return id
5048
},
5149
loadInclude(id) {
5250
if (id === ssrRegisterHelperId) return true
53-
return normalizePath(id) === 'vue-jsx-vapor/runtime'
5451
},
5552
load(id) {
5653
if (id === ssrRegisterHelperId) return ssrRegisterHelperCode
57-
if (normalizePath(id) === 'vue-jsx-vapor/runtime') return runtimeCode
5854
},
5955
transformInclude,
6056
transform(code, id, opt?: { ssr?: boolean }) {

0 commit comments

Comments
 (0)