-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json.examples
More file actions
50 lines (45 loc) · 1.42 KB
/
Copy pathpackage.json.examples
File metadata and controls
50 lines (45 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
"name": "your-project",
"version": "1.0.0",
"scripts": {
"// Option 1: Manual copy script": "",
"copy-wasm": "npx texture2ddecoder-copy-wasm public/wasm",
"prebuild": "npm run copy-wasm",
"prestart": "npm run copy-wasm",
"// Option 2: Automatic postinstall (runs after npm install)": "",
"postinstall": "npx texture2ddecoder-copy-wasm public/wasm",
"// Option 3: Custom destination for different frameworks": "",
"copy-wasm:vite": "npx texture2ddecoder-copy-wasm public/wasm",
"copy-wasm:next": "npx texture2ddecoder-copy-wasm public/wasm",
"copy-wasm:svelte": "npx texture2ddecoder-copy-wasm static/wasm",
"copy-wasm:angular": "npx texture2ddecoder-copy-wasm src/assets/wasm",
"// Your build scripts": "",
"dev": "vite",
"build": "vite build",
"start": "vite preview"
},
"dependencies": {
"texture2ddecoder-wasm": "^1.2.0"
},
"devDependencies": {
"vite": "^5.0.0"
}
}
/*
* NOTES:
*
* 1. postinstall approach:
* - Pros: Automatic, runs after npm install
* - Cons: Runs on every install, may slow down CI/CD
*
* 2. prebuild/prestart approach:
* - Pros: Only runs when needed
* - Cons: Must remember to run build/start scripts
*
* 3. Manual script approach:
* - Pros: Full control
* - Cons: Must remember to run manually
*
* RECOMMENDATION:
* Use prebuild + prestart for best balance of automation and control
*/