Skip to content

Commit 979d628

Browse files
committed
add @vitejs/plugin-react to transform JSX files before external-globals-plugin
1 parent 589edb5 commit 979d628

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

packages/dialtone-vue/.storybook/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { createRequire } from 'node:module';
33
import { dirname, join } from 'node:path';
44
import { mergeConfig } from 'vite';
5+
import react from '@vitejs/plugin-react';
56

67
const require = createRequire(import.meta.url);
78

@@ -28,6 +29,11 @@ const config = {
2829
async viteFinal (config) {
2930
// Merge custom configuration into the default config
3031
return mergeConfig(config, {
32+
// @vitejs/plugin-react ensures .jsx files are transformed before
33+
// Storybook's external-globals-plugin (which uses es-module-lexer
34+
// and cannot parse JSX). Scoped to .jsx only to avoid conflicts
35+
// with Vue's SFC compiler.
36+
plugins: [react({ include: /\.jsx$/, jsxRuntime: 'classic' })],
3137
build: {
3238
sourcemap: true,
3339
},

packages/dialtone-vue/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"@dialpad/dialtone-icons": "workspace:*",
1919
"@dialpad/i18n": "1.25.0",
2020
"@tiptap/core": "3.19.0",
21-
"@tiptap/static-renderer": "3.19.0",
2221
"@tiptap/extension-blockquote": "3.19.0",
2322
"@tiptap/extension-bold": "3.19.0",
2423
"@tiptap/extension-bubble-menu": "3.19.0",
@@ -47,6 +46,7 @@
4746
"@tiptap/extension-underline": "3.19.0",
4847
"@tiptap/extensions": "3.19",
4948
"@tiptap/pm": "3.19.0",
49+
"@tiptap/static-renderer": "3.19.0",
5050
"@tiptap/suggestion": "3.19.0",
5151
"@tiptap/vue-3": "3.19.0",
5252
"date-fns": "4.1.0",
@@ -65,12 +65,13 @@
6565
"@storybook/addon-links": "10.3.0",
6666
"@storybook/test-runner": "^0.24.2",
6767
"@storybook/vue3-vite": "10.3.0",
68+
"@vitejs/plugin-react": "6.0.1",
6869
"@vue/test-utils": "^2.4.0",
6970
"@vueless/storybook-dark-mode": "^10.0.7",
7071
"react": "19.2.4",
72+
"react-dom": "19.2.4",
7173
"storybook": "10.3.0",
72-
"vue": "^3.3.4",
73-
"react-dom": "19.2.4"
74+
"vue": "^3.3.4"
7475
},
7576
"peerDependencies": {
7677
"@dialpad/dialtone-css": "workspace:^",

pnpm-lock.yaml

Lines changed: 29 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)