Skip to content

Commit

Permalink
📘 feat: cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Jun 4, 2023
1 parent 3266284 commit 69a130d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
22 changes: 0 additions & 22 deletions .swc.cjs.swcrc

This file was deleted.

File renamed without changes.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.5.14 - 4 June 2023
Improvement:
- Using tsc to compile CommonJS instead of SWC to support `module.exports` syntax

# 0.5.13 - 4 June 2023
Bug fix:
- Add loosen type for onError's code for defying custom error status
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "elysia",
"description": "Fast, and friendly Bun web framework",
"version": "0.5.13",
"version": "0.5.14",
"author": {
"name": "saltyAom",
"url": "https://github.com/SaltyAom",
Expand Down Expand Up @@ -100,8 +100,8 @@
"test:types": "tsc --project tsconfig.test.json",
"dev": "bun run --hot example/http.ts",
"build": "rimraf dist && npm run build:esm && npm run build:cjs",
"build:esm": "swc src --config-file .swc.esm.swcrc -d dist && tsc --project tsconfig.esm.json",
"build:cjs": "swc src --config-file .swc.cjs.swcrc -d dist/cjs && tsc --project tsconfig.cjs.json",
"build:esm": "swc src -d dist && tsc --project tsconfig.esm.json",
"build:cjs": "tsc --project tsconfig.cjs.json",
"release": "npm run release:test && npm run release:github",
"release:test": "npm run build && npm run test",
"release:github": "bumpp package.json --commit --push --tag",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/* Emit */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
"emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "./dist/cjs", /* Specify an output folder for all emitted files. */
Expand All @@ -70,7 +70,7 @@

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
Expand Down

0 comments on commit 69a130d

Please # to comment.