@@ -4,47 +4,23 @@ export default defineConfig({
44 // Entry points
55 entry : [ 'src/index.ts' ] ,
66
7- // Output formats
8- format : [ 'esm ' , 'cjs ' ] ,
7+ // Output formats - Build both formats for proper metadata
8+ format : [ 'cjs ' , 'esm ' ] ,
99
10- // Output options
11- outDir : 'dist' ,
12- clean : true ,
13-
14- // Code generation
15- target : 'es2022' ,
16- minify : false , // Keep readable for debugging
17- sourcemap : false , // Following redlock-universal best practice
10+ // TypeScript - Generate declaration files
11+ dts : true ,
1812
19- // TypeScript
20- dts : true , // Generate .d.ts files
21- splitting : false , // Keep simple for library
22-
23- // Bundling
24- treeshake : true ,
25- external : [
26- // Peer dependencies should be external
27- '@nestjs/common' ,
28- '@nestjs/core' ,
29- 'redlock-universal' ,
30- 'reflect-metadata' ,
31- ] ,
13+ // Build configuration
14+ splitting : false ,
15+ sourcemap : true ,
16+ clean : true ,
3217
33- // Banner for CJS compatibility
34- banner : {
35- js : `
36- /**
37- * nestjs-redlock-universal
38- * NestJS integration for redlock-universal
39- */` . trim ( ) ,
40- } ,
18+ // CRITICAL: Preserve decorator metadata
19+ keepNames : true ,
4120
42- // Platform
43- platform : 'node ' ,
21+ // Explicitly use tsconfig for decorator settings
22+ tsconfig : './tsconfig.json ' ,
4423
45- // esbuild options
46- esbuildOptions ( options ) {
47- options . conditions = [ 'node' ] ;
48- options . mainFields = [ 'module' , 'main' ] ;
49- } ,
24+ // External dependencies - don't bundle peer deps
25+ external : [ '@nestjs/common' , '@nestjs/core' , 'redlock-universal' , 'reflect-metadata' ] ,
5026} ) ;
0 commit comments