@@ -3,7 +3,6 @@ import type { FilterPattern } from "@rollup/pluginutils";
3
3
import type { ParserPlugin , ParserOptions } from "@babel/parser" ;
4
4
import type { TransformOptions } from "@babel/core" ;
5
5
6
- import resolve from "resolve" ;
7
6
import prefresh from "@prefresh/vite" ;
8
7
import { preactDevtoolsPlugin } from "./devtools.js" ;
9
8
import { createFilter , parseId } from "./utils.js" ;
@@ -94,24 +93,6 @@ export default function preactPlugin({
94
93
configResolved ( resolvedConfig ) {
95
94
config = resolvedConfig ;
96
95
} ,
97
- resolveId ( id : string ) {
98
- return id === "preact/jsx-runtime" ? id : null ;
99
- } ,
100
- load ( id : string ) {
101
- if ( id === "preact/jsx-runtime" ) {
102
- const runtimePath = resolve . sync ( "preact/jsx-runtime" , {
103
- basedir : config . root ,
104
- } ) ;
105
- const exports = [ "jsx" , "jsxs" , "Fragment" ] ;
106
- return [
107
- `import * as jsxRuntime from ${ JSON . stringify ( runtimePath ) } ` ,
108
- // We can't use `export * from` or else any callsite that uses
109
- // this module will be compiled to `jsxRuntime.exports.jsx`
110
- // instead of the more concise `jsx` alias.
111
- ...exports . map ( name => `export const ${ name } = jsxRuntime.${ name } ` ) ,
112
- ] . join ( "\n" ) ;
113
- }
114
- } ,
115
96
async transform ( code , url ) {
116
97
// Ignore query parameters, as in Vue SFC virtual modules.
117
98
const { id } = parseId ( url ) ;
0 commit comments