Skip to content

Commit 5eeaa71

Browse files
fix: declaration file generation
1 parent dbc1d86 commit 5eeaa71

File tree

3 files changed

+24
-32
lines changed

3 files changed

+24
-32
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ecctrl",
3-
"version": "1.0.74",
3+
"version": "1.0.75",
44
"author": "Erdong Chen",
55
"license": "MIT",
66
"description": "A floating rigibody character controller for R3F",
@@ -37,7 +37,7 @@
3737
"@types/react-dom": "^18.2.8",
3838
"@vitejs/plugin-react": "^4.1.0",
3939
"r3f-perf": "^7.1.2",
40-
"typescript": "^5.2.2",
40+
"typescript": "^5.4.3",
4141
"vite": "^4.3.9"
4242
},
4343
"dependencies": {

vite.config.js

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,39 @@
1-
import { defineConfig } from 'vite'
2-
import * as path from 'node:path'
3-
import react from '@vitejs/plugin-react'
1+
import { defineConfig } from "vite";
2+
import * as path from "node:path";
3+
import react from "@vitejs/plugin-react";
44

5-
const isCodeSandbox = 'SANDBOX_URL' in process.env || 'CODESANDBOX_HOST' in process.env
5+
const isCodeSandbox =
6+
"SANDBOX_URL" in process.env || "CODESANDBOX_HOST" in process.env;
67

78
const dev = defineConfig({
89
plugins: [react()],
9-
root: 'example/',
10-
publicDir: '../public/',
11-
base: './',
10+
root: "example/",
11+
publicDir: "../public/",
12+
base: "./",
1213
server: {
1314
host: true,
1415
open: !isCodeSandbox, // Open if it's not a CodeSandbox
1516
},
16-
})
17+
});
1718

1819
const build = defineConfig({
1920
publicDir: false,
2021
build: {
2122
minify: false,
2223
sourcemap: true,
23-
target: 'es2018',
24+
target: "es2018",
2425
lib: {
25-
formats: ['cjs', 'es'],
26-
entry: 'src/Ecctrl.tsx',
27-
fileName: '[name]',
26+
formats: ["cjs", "es"],
27+
entry: "src/Ecctrl.tsx",
28+
fileName: "[name]",
2829
},
2930
rollupOptions: {
30-
external: (id) => !id.startsWith('.') && !path.isAbsolute(id),
31+
external: (id) => !id.startsWith(".") && !path.isAbsolute(id),
3132
output: {
3233
sourcemapExcludeSources: true,
3334
},
3435
},
3536
},
36-
plugins: [
37-
{
38-
name: 'vite-tsc',
39-
generateBundle(options) {
40-
const ext = options.format === 'es' ? 'ts' : 'cts'
41-
this.emitFile({ type: 'asset', fileName: `Ecctrl.d.${ext}`, source: `export * from '../src/Ecctrl.tsx'` })
42-
},
43-
},
44-
]
45-
})
37+
});
4638

47-
export default process.argv[2] ? build : dev
39+
export default process.argv[2] ? build : dev;

0 commit comments

Comments
 (0)