build: make jsx-runtime be an isolated package

This commit is contained in:
Nick the Sick 2024-10-24 00:29:07 +02:00
parent dd7ea894f8
commit ffd9a46cc4
No known key found for this signature in database
GPG Key ID: F575992F156E5BCC
6 changed files with 18 additions and 11 deletions

View File

@ -1 +1 @@
export * from '../dist/index.cjs'
export * from '../dist/jsx-runtime.cjs'

View File

@ -1 +1 @@
export * from '../dist/index.js'
export * from '../dist/jsx-runtime.js'

View File

@ -2,4 +2,12 @@ import { baseConfig } from '@tiptap-shared/rollup-config'
import pkg from './package.json' assert { type: 'json' }
export default baseConfig({ input: 'src/index.ts', pkg })
export default [baseConfig({ input: 'src/index.ts', pkg }), baseConfig({
input: 'src/jsx-runtime.ts',
pkg: {
name: '@tiptap/core/jsx-runtime',
main: 'dist/jsx-runtime.cjs',
module: 'dist/jsx-runtime.js',
umd: 'dist/jsx-runtime.umd.js',
},
})]

View File

@ -5,11 +5,7 @@ export * as extensions from './extensions/index.js'
export * from './helpers/index.js'
export * from './InputRule.js'
export * from './inputRules/index.js'
export {
createElement,
Fragment,
createElement as h,
} from './jsx-runtime.js'
export * from './jsx-runtime.js'
export * from './Mark.js'
export * from './Node.js'
export * from './NodePos.js'

View File

@ -1,4 +1,4 @@
export type Attributes = Record<string, any>;
type Attributes = Record<string, any>;
export type DOMOutputSpecElement = 0 | Attributes | DOMOutputSpecArray;
/**
@ -43,5 +43,8 @@ export const h: JSXRenderer = (tag, attributes, ...children) => {
// https://www.typescriptlang.org/tsconfig/#jsxImportSource
export {
h as createElement, h as jsx, h as jsxDEV, h as jsxs,
h as createElement,
h as jsx,
h as jsxDEV,
h as jsxs,
}

View File

@ -3,7 +3,7 @@
"target": "es2019",
"module": "esnext",
"strict": true,
"jsx": "react",
"jsx": "react-jsx",
"importHelpers": true,
"moduleResolution": "node",
"resolveJsonModule": true,