Skip to content

Commit

Permalink
add tsup to qr-code-handler
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Ruck <[email protected]>
  • Loading branch information
Manuel Ruck committed Oct 8, 2023
1 parent fedbd7a commit b22476c
Show file tree
Hide file tree
Showing 4 changed files with 396 additions and 6 deletions.
8 changes: 5 additions & 3 deletions services/qr-code-handler/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "qr-code-handler",
"version": "1.0.3",
"version": "1.0.4",
"main": "built/index.js",
"scripts": {
"dev": "tsnd src/index.ts",
"build": "tsc",
"dev": "tsup src/index.ts --watch --sourcemap --onSuccess 'node dist/index.js'",
"build": "tsup-node",
"start": "node build/index.js"
},
"license": "MIT",
Expand All @@ -13,9 +13,11 @@
"mongoose": "^5.10.0"
},
"devDependencies": {
"@swc/core": "^1.3.92",
"@types/express": "^4.17.7",
"@types/mongoose": "^5.7.36",
"ts-node-dev": "^1.0.0-pre.57",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
}
}
2 changes: 1 addition & 1 deletion services/qr-code-handler/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./build" /* Redirect output structure to the directory. */,
// "outDir": "./dist" /* Redirect output structure to the directory. */,
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
Expand Down
13 changes: 13 additions & 0 deletions services/qr-code-handler/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'tsup';

export default defineConfig({
dts: true, // Generate .d.ts files
minify: true, // Minify output
sourcemap: true, // Generate sourcemaps
treeshake: true, // Remove unused code
splitting: true, // Split output into chunks
clean: true, // Clean output directory before building
outDir: 'build', // Output directory
entry: ['src/index.ts'], // Entry point(s)
format: ['cjs'], // Output format(s)
});
Loading

0 comments on commit b22476c

Please sign in to comment.