@@ -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" ;
@@ -89,24 +88,6 @@ export default function preactPlugin({
89
88
configResolved ( resolvedConfig ) {
90
89
config = resolvedConfig ;
91
90
} ,
92
- resolveId ( id : string ) {
93
- return id === "preact/jsx-runtime" ? id : null ;
94
- } ,
95
- load ( id : string ) {
96
- if ( id === "preact/jsx-runtime" ) {
97
- const runtimePath = resolve . sync ( "preact/jsx-runtime" , {
98
- basedir : config . root ,
99
- } ) ;
100
- const exports = [ "jsx" , "jsxs" , "Fragment" ] ;
101
- return [
102
- `import * as jsxRuntime from ${ JSON . stringify ( runtimePath ) } ` ,
103
- // We can't use `export * from` or else any callsite that uses
104
- // this module will be compiled to `jsxRuntime.exports.jsx`
105
- // instead of the more concise `jsx` alias.
106
- ...exports . map ( name => `export const ${ name } = jsxRuntime.${ name } ` ) ,
107
- ] . join ( "\n" ) ;
108
- }
109
- } ,
110
91
async transform ( code , url ) {
111
92
// Ignore query parameters, as in Vue SFC virtual modules.
112
93
const { id } = parseId ( url ) ;
0 commit comments