diff --git a/index.js b/index.js new file mode 100644 index 0000000..06179ed --- /dev/null +++ b/index.js @@ -0,0 +1,4 @@ +require = require('esm')(module /*, options*/); +module.exports = { + ...require('./dist/libs/autocrud'), +}; diff --git a/libs/autocrud/src/index.ts b/libs/autocrud/src/index.ts index e223a89..942c7e8 100644 --- a/libs/autocrud/src/index.ts +++ b/libs/autocrud/src/index.ts @@ -1,3 +1,4 @@ +import 'reflect-metadata'; export * from './autocrud.module'; export * from './autocrud.service'; export * from './autocrud.controller'; diff --git a/libs/autocrud/tsconfig.lib.json b/libs/autocrud/tsconfig.lib.json index e32acce..e2305a4 100644 --- a/libs/autocrud/tsconfig.lib.json +++ b/libs/autocrud/tsconfig.lib.json @@ -1,9 +1,25 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "module": "commonjs", "declaration": true, - "outDir": "../../dist/libs/autocrud" + "noImplicitAny": false, + "removeComments": true, + "noLib": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es6", + "sourceMap": false, + "outDir": "../../dist/libs/autocrud", + "skipLibCheck": true, }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] -} + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "dist", + "test", + "**/*spec.ts" + ] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4b2930a..8d79c21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@nestjs/common": "^10.0.0", "@nestjs/core": "^10.0.0", "@nestjs/platform-express": "^10.0.0", + "esm": "^3.2.25", "reflect-metadata": "^0.2.0", "rxjs": "^7.8.1" }, @@ -4326,6 +4327,15 @@ "node": "*" } }, + "node_modules/esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/espree": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", diff --git a/package.json b/package.json index 48969b1..2f2190a 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "license": "UNLICENSED", "scripts": { "build": "nest build", + "build:lib:autocrud": "tsc -p libs/autocrud/tsconfig.lib.json", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"libs/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch", @@ -23,6 +24,7 @@ "@nestjs/common": "^10.0.0", "@nestjs/core": "^10.0.0", "@nestjs/platform-express": "^10.0.0", + "esm": "^3.2.25", "reflect-metadata": "^0.2.0", "rxjs": "^7.8.1" },