Skip to content

Commit

Permalink
ESM rollup config of SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Jul 8, 2024
1 parent 441c042 commit fca07a2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 10 deletions.
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "rimraf prisma/migrations && node bin/test",
"------------------------BUILDS------------------------": "",
"build": "npm run build:prisma && npm run build:sdk && npm run build:main && npm run build:test",
"build:api": "rimraf packages/api/lib && nestia sdk && tsc -p packages/api/tsconfig.json",
"build:api": "rimraf packages/api/lib && nestia sdk && rimraf packages/api/lib && tsc -p packages/api/tsconfig.json && rollup -c packages/api/rollup.config.js",
"build:main": "rimraf lib && tsc",
"build:prisma": "prisma generate --schema=prisma/schema.prisma",
"build:sdk": "rimraf src/api/functional && nestia sdk",
Expand Down Expand Up @@ -40,7 +40,9 @@
"homepage": "https://github.com/samchon/backend",
"devDependencies": {
"@nestia/e2e": "^0.6.0",
"@nestia/sdk": "^3.2.5",
"@nestia/sdk": "^3.5.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/cli": "^0.11.19",
"@types/cli-progress": "^3.11.5",
Expand All @@ -65,20 +67,21 @@
"prettier-plugin-prisma": "^5.0.0",
"prisma-markdown": "^1.0.9",
"rimraf": "^3.0.2",
"rollup": "^4.18.0",
"sloc": "^0.2.1",
"swagger-ui-express": "^5.0.0",
"ts-loader": "^9.5.0",
"ts-node": "^10.9.2",
"ts-patch": "^3.1.2",
"typescript": "<5.6.0",
"ts-patch": "^3.2.1",
"typescript": "^5.5.3",
"typescript-transform-paths": "^3.4.6",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4",
"write-file-webpack-plugin": "^4.5.1"
},
"dependencies": {
"@nestia/core": "^3.2.5",
"@nestia/fetcher": "^3.2.5",
"@nestia/core": "^3.5.0",
"@nestia/fetcher": "^3.5.0",
"@nestjs/common": "^10.3.8",
"@nestjs/core": "^10.3.8",
"@nestjs/platform-express": "^10.3.8",
Expand All @@ -90,9 +93,9 @@
"prisma": "^5.13.0",
"serialize-error": "^4.1.0",
"source-map-support": "^0.5.19",
"tgrid": "^1.0.1",
"tgrid": "^1.0.2",
"tstl": "^3.0.0",
"typia": "^6.2.1"
"typia": "^6.4.3"
},
"private": true
}
5 changes: 3 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"description": "API for PROJECT",
"main": "lib/index.js",
"module": "lib/index.mjs",
"typings": "lib/index.d.ts",
"repository": {
"type": "git",
Expand All @@ -15,8 +16,8 @@
},
"homepage": "https://github.com/samchon/backend#readme",
"dependencies": {
"@nestia/fetcher": "^3.2.5",
"typia": "^6.2.1"
"@nestia/fetcher": "^3.5.0",
"typia": "^6.4.3"
},
"include": [
"lib",
Expand Down
29 changes: 29 additions & 0 deletions packages/api/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const typescript = require("@rollup/plugin-typescript");
const terser = require("@rollup/plugin-terser");

module.exports = {
input: `${__dirname}/../../src/api/index.ts`,
output: {
dir: `${__dirname}/lib`,
format: "esm",
entryFileNames: "[name].mjs",
sourcemap: true,
},
plugins: [
typescript({
tsconfig: `${__dirname}/tsconfig.json`,
module: "ESNext",
target: "ESNext",
}),
terser({
format: {
comments: "some",
beautify: true,
ecma: "2020",
},
compress: false,
mangle: false,
module: true,
}),
],
};

0 comments on commit fca07a2

Please sign in to comment.