Skip to content

Commit 0d9be31

Browse files
committed
Fix jsdelivr
1 parent e2e9d29 commit 0d9be31

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
packahe-lock.json
2+
packahe-lock.json
3+
dist

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33
"version": "1.0.0",
44
"description": "KHR_animation_pointer support for three.js",
55
"type": "module",
6-
"main": "src/index.js",
6+
"main": "dist/three-animation-pointer.umd.js",
7+
"module": "dist/three-animation-pointer.es.js",
78
"types": "types/index.d.ts",
89
"exports": {
910
".": {
10-
"import": "./src/index.js"
11+
"import": "./dist/three-animation-pointer.es.js",
12+
"require": "./dist/three-animation-pointer.umd.js",
13+
"types": "./types/index.d.ts"
1114
}
1215
},
1316
"files": [
1417
"src",
18+
"dist",
1519
"types",
1620
"package.json",
1721
"README.md",
@@ -27,8 +31,13 @@
2731
"url": "https://github.com/needle-tools/three-animation-pointer"
2832
},
2933
"license": "MIT",
34+
"scripts": {
35+
"build": "vite build",
36+
"prepublishOnly": "npm run build"
37+
},
3038
"devDependencies": {
31-
"three": ">=0.179.1"
39+
"three": ">=0.179.1",
40+
"vite": "^5.0.0"
3241
},
3342
"peerDependencies": {
3443
"three": ">=0.165.0"

vite.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { defineConfig } from 'vite';
2+
3+
export default defineConfig({
4+
build: {
5+
lib: {
6+
entry: 'src/index.js',
7+
name: 'ThreeAnimationPointer',
8+
fileName: (format) => `three-animation-pointer.${format}.js`,
9+
formats: ['es', 'umd']
10+
},
11+
rollupOptions: {
12+
external: ['three'],
13+
output: {
14+
globals: {
15+
'three': 'THREE'
16+
}
17+
}
18+
},
19+
outDir: 'dist'
20+
}
21+
});

0 commit comments

Comments
 (0)