Skip to content

Commit e32ff5a

Browse files
committed
fix jsx import
1 parent 4f9a50c commit e32ff5a

File tree

4 files changed

+6
-19
lines changed

4 files changed

+6
-19
lines changed

rollup.config.mjs

+1-16
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,12 @@ export default defineConfig([
1717
swc.rollup({
1818
minify: true,
1919
jsc: {
20-
baseUrl: import.meta.dirname,
20+
baseUrl: import.meta.dirname || '.',
2121
paths: {
2222
'@/*': ['./src/*'],
2323
},
2424
},
2525
}),
2626
],
2727
},
28-
29-
// CommonJS (for Node) and ES module (for bundlers) build.
30-
// (We could have three entries in the configuration array
31-
// instead of two, but it's quicker to generate multiple
32-
// builds from a single configuration where possible, using
33-
// an array for the `output` option, where we can specify
34-
// `file` and `format` for each target)
35-
// {
36-
// input: 'src/main.js',
37-
// external: ['ms'],
38-
// output: [
39-
// { file: pkg.main, format: 'cjs' },
40-
// { file: pkg.module, format: 'es' },
41-
// ],
42-
// },
4328
]);

src/components/search.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { escapeHTML, nextTick } from '@/utils/main';
55
import { Component } from './base';
66
import { router } from '@/anatolo/router';
77
import { SearchResourceCollection, SearchResource, SearchResourcePage } from '@/types/search';
8+
import { h } from '@/utils/main';
89

910
const SEARCH_RESULT_LIMIT = 5;
1011

src/utils/friend-link.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { escapeHTML } from './escape-html';
2+
import { h } from './jsx-runtime';
23

34
export function make_friends_list() {
45
try {

tsconfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
/* Language and Environment */
1414
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
1515
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16-
"jsx": "preserve", /* Specify what JSX code is generated. */
16+
"jsx": "preserve", /* Specify what JSX code is generated. */
1717
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
1818
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19-
"jsxFactory": "h", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
19+
"jsxFactory": "h", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
2020
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21-
"jsxImportSource": "@/utils", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
21+
// "jsxImportSource": "@/utils", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
2222
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
2323
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
2424
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */

0 commit comments

Comments
 (0)