Skip to content

Commit f35d250

Browse files
committed
fix: include react components in build
1 parent 73e0088 commit f35d250

File tree

6 files changed

+98
-308
lines changed

6 files changed

+98
-308
lines changed

.changeset/quiet-trees-decide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-dsv-import': patch
3+
---
4+
5+
Include react components in build

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@swc/core": "~1.10.1",
3939
"@swc/helpers": "~0.5.15",
4040
"@types/node": "^22.10.2",
41+
"@vitejs/plugin-react": "^4.3.4",
4142
"@vitest/coverage-v8": "^2.1.8",
4243
"@vitest/ui": "^2.1.8",
4344
"eslint": "^9.17.0",
@@ -58,5 +59,10 @@
5859
},
5960
"dependencies": {
6061
"react-dsv-import": "workspace:*"
62+
},
63+
"pnpm": {
64+
"overrides": {
65+
"vite": "^6.0.3"
66+
}
6167
}
6268
}

packages/react-dsv-import/tsconfig.lib.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55
"declaration": true,
66
"types": ["node", "vite/client"]
77
},
8-
"include": ["src/**/*.ts", "setupTests.ts"],
8+
"include": ["src/**/*.{ts,tsx}", "setupTests.ts"],
99
"exclude": [
1010
"jest.config.ts",
11-
"src/**/*.spec.ts",
12-
"src/**/*.test.ts",
13-
"**/*.stories.ts",
14-
"**/*.stories.js",
15-
"**/*.stories.jsx",
16-
"**/*.stories.tsx"
11+
"src/**/*.{spec,test}.{ts,tsx}",
12+
"**/*.stories.{ts,js,jsx,tsx}",
1713
]
1814
}

packages/react-dsv-import/vite.config.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
/// <reference types='vitest' />
22
import { defineConfig } from 'vite';
3+
import react from '@vitejs/plugin-react';
34
import dts from 'vite-plugin-dts';
45
import * as path from 'node:path';
56
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
7+
import { coverageConfigDefaults } from 'vitest/config';
68

79
export default defineConfig({
810
root: __dirname,
911
cacheDir: '../../node_modules/.vite/react-dsv-import',
1012
plugins: [
13+
react(),
1114
nxViteTsPaths(),
1215
dts({
1316
entryRoot: 'src',
@@ -26,7 +29,7 @@ export default defineConfig({
2629
build: {
2730
lib: {
2831
// Could also be a dictionary or array of multiple entry points.
29-
entry: 'src/index.ts',
32+
entry: 'src/index.tsx',
3033
name: 'react-dsv-import',
3134
fileName: 'index',
3235
// Change this to the formats you want to support.
@@ -49,6 +52,7 @@ export default defineConfig({
4952
environment: 'jsdom',
5053
coverage: {
5154
reportsDirectory: '../../coverage/packages/react-dsv-import',
55+
exclude: ['stories', 'storybook-static', ...coverageConfigDefaults.exclude],
5256
},
5357
setupFiles: './setupTests.ts',
5458
reporters: ['verbose'],

0 commit comments

Comments
 (0)