Skip to content

Commit f3d188f

Browse files
committed
chore: 新增构建脚本
1 parent 8ea0218 commit f3d188f

File tree

6 files changed

+46
-6
lines changed

6 files changed

+46
-6
lines changed

bun.lock

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

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"version": "0.15.1",
44
"description": "Interface package for NEXT FlOW. You can use this package to build your own plugin that can control anything.",
55
"main": "dist/index.js",
6-
"types": "dist/index.d.ts",
6+
"types": "dist/types/index.d.ts",
77
"scripts": {
8-
"watch": "tsc --watch",
8+
"watch": "bun build ./src/index.ts --outdir ./dist --watch --packages external --sourcemap",
9+
"watch-type": "tsc --emitDeclarationOnly --watch",
910
"test": "echo All tests passed.",
10-
"build": "tsc",
11+
"build": "bun build ./src/index.ts --outdir ./dist --packages external --minify",
12+
"biuld-type": "tsc --emitDeclarationOnly",
1113
"type:check": "tsc --noEmit",
1214
"lint": "eslint --fix .",
1315
"lint:check": "eslint .",
@@ -52,6 +54,7 @@
5254
"@typescript-eslint/project-service": "^8.33.1",
5355
"antd": "5.24.1",
5456
"brotli-wasm": "^3.0.1",
57+
"bun-plugin-dtsx": "^0.9.5",
5558
"clsx": "2.1.1",
5659
"eslint": "^9.28.0",
5760
"eslint-config-prettier": "^10.1.5",

scripts/build.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import dts from 'bun-plugin-dtsx'
2+
3+
await Bun.build({
4+
entrypoints: ['./src/index.ts'],
5+
outdir: './dist',
6+
packages: 'external',
7+
minify: true,
8+
plugins: [
9+
dts({
10+
cwd: './',
11+
root: './src',
12+
outdir: './dist/types',
13+
bundle: true,
14+
} as any)
15+
],
16+
})

scripts/watch.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import dts from 'bun-plugin-dtsx'
2+
3+
await Bun.build({
4+
entrypoints: ['./src/index.ts'],
5+
outdir: './dist',
6+
packages: 'external',
7+
sourcemap: 'linked',
8+
minify: true,
9+
plugins: [
10+
dts({
11+
cwd: './',
12+
root: './src',
13+
outdir: './dist/types',
14+
} as any)
15+
],
16+
})

src/api/nfp-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import RsTransformGroundApi from '@/api/service/engine/render/environment/rs-tra
2929
import RsLabelServiceApi from '@/api/service/engine/render/label/rs-label-service-api'
3030
import RsNodeMaterialManagerApi from '@/api/service/engine/render/material/node/rs-node-material-manager-api'
3131
import RsMaterialServiceApi from '@/api/service/engine/render/material/rs-material-service-api'
32+
import RsSeparateServiceApi
33+
from '@/api/service/engine/render/material/separate/rs-separate-service-api'
3234
import FirstLoadModelServiceApi from '@/api/service/engine/render/model/first/first-load-model-service-api'
3335
import RsModelServiceApi from '@/api/service/engine/render/model/rs-model-service-api'
3436
import RsServiceApi from '@/api/service/engine/rs-service-api'
@@ -93,8 +95,6 @@ import SyncServiceApi from './service/sync/sync-service-api'
9395
import TAttributesServiceApi from './service/target/attribute/t-attributes-service-api'
9496

9597
import type { FunctionComponent } from 'react'
96-
import RsSeparateServiceApi
97-
from '@/api/service/engine/render/material/separate/rs-separate-service-api'
9898

9999
export interface NfpApi {
100100
services: {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"typeRoots": ["./node_modules/@types", "./src/types"],
2929

3030
"declaration": true,
31-
"declarationMap": true,
31+
"declarationMap": false,
3232
"emitDeclarationOnly": false,
3333

3434
"paths": {

0 commit comments

Comments
 (0)