Skip to content

Commit dde8b18

Browse files
Support building SDK
1 parent 460ff2e commit dde8b18

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ node_modules/
44
.idea/
55
.vscode/
66
backup/
7+
src/CubismSdkForWeb-*/
8+
build/CubismSdkForWeb-*/

eslint.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,13 @@ export default tseslint.config(
1212
quotes: ['error', 'single'],
1313
indent: ['error', 2],
1414
}
15+
},
16+
{
17+
ignores: [
18+
'src/CubismSdkForWeb-*/**',
19+
'dist/**',
20+
'build/**',
21+
'node_modules/**'
22+
]
1523
}
1624
);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
},
3737
"devDependencies": {
3838
"@eslint/js": "9.26.0",
39+
"@rollup/plugin-alias": "^5.1.1",
3940
"@rollup/plugin-terser": "0.4.4",
4041
"@types/node": "22.15.14",
4142
"eslint": "9.26.0",

rollup.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import terser from '@rollup/plugin-terser';
2+
import alias from '@rollup/plugin-alias';
3+
import path from 'path';
4+
import { fileURLToPath } from 'url';
5+
6+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
27

38
function banner() {
49

@@ -22,8 +27,21 @@ export default {
2227
output: {
2328
dir: 'dist/',
2429
format: 'esm',
30+
chunkFileNames: 'chunk/[name].js',
2531
},
2632
plugins: [
33+
alias({
34+
entries: [
35+
{
36+
find: '@demo',
37+
replacement: path.resolve(__dirname, 'build/CubismSdkForWeb-5-r.4/Samples/TypeScript/Demo/src/')
38+
},
39+
{
40+
find: '@framework',
41+
replacement: path.resolve(__dirname, 'build/CubismSdkForWeb-5-r.4/Framework/src/')
42+
}
43+
]
44+
}),
2745
banner(),
2846
terser(),
2947
],

tsconfig.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@
77
"outDir": "build",
88
"esModuleInterop": true,
99
"forceConsistentCasingInFileNames": true,
10-
"strict": true,
10+
"strict": false,
1111
"skipLibCheck": true,
1212
"removeComments": true,
13-
"allowJs": true
13+
"allowJs": true,
14+
"paths": {
15+
"@framework/*": [
16+
"./src/CubismSdkForWeb-5-r.4/Framework/src/*"
17+
],
18+
"@demo/*": [
19+
"./src/CubismSdkForWeb-5-r.4/Samples/TypeScript/Demo/src/*"
20+
]
21+
}
1422
},
1523
"include": ["src"],
1624
"exclude": ["node_modules", "build", "dist"]

0 commit comments

Comments
 (0)