Skip to content

Commit d68ed9f

Browse files
committed
Fix jsdelivr
1 parent e2e9d29 commit d68ed9f

File tree

5 files changed

+40
-5
lines changed

5 files changed

+40
-5
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
node-version: '22'
2424
cache: 'npm'
2525
cache-dependency-path: './package.json'
26+
27+
- name: Install dependencies
28+
run: npm install
2629

2730
- name: Publish to npm (stable branch)
2831
if: startsWith(github.ref_name, 'release/stable')

.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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { GLTFAnimationPointerExtension } from "@needle-tools/three-animation-poi
1616
const loader = new GLTFLoader();
1717
loader.register(p => {
1818
return new GLTFAnimationPointerExtension(p);
19-
}
19+
});
2020
```
2121

2222
## Links

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.js",
7+
"module": "dist/three-animation-pointer.js",
78
"types": "types/index.d.ts",
89
"exports": {
910
".": {
10-
"import": "./src/index.js"
11+
"types": "./types/index.d.ts",
12+
"import": "./dist/three-animation-pointer.js",
13+
"require": "./dist/three-animation-pointer.js"
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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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) => format === 'es' ? 'three-animation-pointer.js' : `three-animation-pointer.${format}.js`,
9+
formats: ['es']
10+
},
11+
rollupOptions: {
12+
external: ['three'],
13+
output: {
14+
exports: 'named',
15+
globals: {
16+
'three': 'THREE'
17+
}
18+
}
19+
},
20+
outDir: 'dist'
21+
}
22+
});

0 commit comments

Comments
 (0)