Skip to content

Commit 53cc8cf

Browse files
config
1 parent 465ba67 commit 53cc8cf

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

jest.config.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
module.exports = {
22
preset: "ts-jest",
33
testEnvironment: "./fix-jsdom-env.ts",
4+
globals: {
5+
"ts-jest": {
6+
tsconfig: "tsconfig.test.json",
7+
},
8+
},
49
};

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@
2424
"type": "module",
2525
"scripts": {
2626
"dev": "vite",
27-
"build": "tsc && vite build",
27+
"build": "vite build",
2828
"preview": "vite preview",
2929
"publish-minor": "npm run build && npm version minor && npm publish --access public && git push && git push --tags",
3030
"test": "jest",
3131
"test:update-snapshots": "npm test -- -u"
3232
},
33-
"main": "./dist/json-ui.umd.cjs",
33+
"main": "./dist/json-ui.umd.js",
3434
"module": "./dist/json-ui.es.js",
35-
"types": "./dist/src/index.d.ts",
35+
"types": "./dist/index.d.ts",
3636
"exports": {
3737
".": {
3838
"import": "./dist/json-ui.js",
39-
"require": "./dist/json-ui.umd.cjs"
39+
"require": "./dist/json-ui.umd.js"
4040
}
4141
},
4242
"files": [

tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"esModuleInterop": true,
1010
"declaration": true,
1111
"outDir": "./dist",
12+
"rootDir": "./src",
1213

1314
/* Bundler mode */
1415
"moduleResolution": "bundler",
@@ -23,5 +24,6 @@
2324
"noUnusedParameters": true,
2425
"noFallthroughCasesInSwitch": true
2526
},
26-
"include": ["src"]
27+
"include": ["src"],
28+
"exclude": ["src/**/*.spec.ts"]
2729
}

tsconfig.test.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "./"
5+
},
6+
"include": ["src/**/*.spec.ts"]
7+
}

vite.config.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ export default defineConfig({
1111
},
1212
},
1313
build: {
14+
outDir: "dist",
1415
lib: {
1516
entry: resolve(__dirname, "src/index.ts"),
1617
name: "json-ui",
17-
fileName: (format) => `json-ui.${format}.js`
18+
fileName: (format) => `json-ui.${format}.js`,
19+
},
20+
rollupOptions: {
21+
output: {
22+
dir: "dist",
23+
},
1824
},
19-
rollupOptions: {},
2025
},
2126
});

0 commit comments

Comments
 (0)