Skip to content

Build your personal knowledge base with Trilium Notes

build: add separate tsconfig.build.json

Panagiotis Papadopouloscefc402263cd
diff --git a/package.json b/package.json
index 6cddb2e32d..58e7f68408 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"docs:build-frontend": "rimraf ./docs/frontend_api && jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js",
"docs:build": "npm run docs:build-backend && npm run docs:build-frontend",
"build:webpack": "tsx node_modules/webpack/bin/webpack.js -c webpack.config.ts",
- "build:prepare-dist": "npm run build:webpack && rimraf ./dist && tsc && tsx ./bin/copy-dist.ts",
+ "build:prepare-dist": "npm run build:webpack && rimraf ./dist && tsc -p tsconfig.build.json && tsx ./bin/copy-dist.ts",
"test": "npm run client:test && npm run server:test",
"server:test": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest",
"server:coverage": "cross-env TRILIUM_ENV=dev TRILIUM_DATA_DIR=./integration-tests/db TRILIUM_INTEGRATION_TEST=memory vitest --coverage",
diff --git a/tsconfig.build.json b/tsconfig.build.json
new file mode 100644
index 0000000000..24a9aa5447
--- /dev/null
+++ b/tsconfig.build.json
@@ -0,0 +1,27 @@
+{
+ "compilerOptions": {
+ "module": "NodeNext",
+ "declaration": false,
+ "sourceMap": true,
+ "outDir": "./build",
+ "strict": true,
+ "noImplicitAny": true,
+ "resolveJsonModule": true,
+ "allowJs": true,
+ "lib": ["ES2023"],
+ "downlevelIteration": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "verbatimModuleSyntax": true
+ },
+ "include": ["./src/**/*.[jt]s", "./*.ts"],
+ "exclude": [
+ "./node_modules/**/*",
+ "./spec-es6/**/*.ts",
+ "./spec/**/*",
+ "./**/*.spec.ts",
+ "./src/public/**/*",
+ "./*.config.[jt]s",
+ ],
+ "files": ["src/types.d.ts"]
+}