Skip to content

Commit

Permalink
chore: apply swc & scripting
Browse files Browse the repository at this point in the history
  • Loading branch information
Marades committed Jun 27, 2024
1 parent 6130a90 commit 635ad53
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 8 deletions.
16 changes: 16 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true
},
"transform": {
"decoratorMetadata": true
},
"target": "es2017"
},
"module": {
"type": "commonjs"
}
}
5 changes: 4 additions & 1 deletion nest-cli.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"entryFile": "handler",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
"deleteOutDir": true,
"builder": "swc",
"typeCheck": true
}
}
27 changes: 21 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"prebuild": "if [ -d dist ]; then rm -r dist; fi",
"build": "npx webpack",
"deploy": "npm run build && sls deploy && npm run postdeploy",
"postdeploy": "if [ -d .serverless ]; then rm -r .serverless; fi",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"db:up": "docker-compose up -d",
"db:down": "docker compose down",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"start": "NODE_ENV=local nest start",
"start:dev": "NODE_ENV=local nest start --watch",
"start:prod": "if [ -d dist ]; then node dist/main; fi",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
Expand All @@ -28,9 +30,12 @@
"@nestjs/mongoose": "^10.0.6",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^7.3.1",
"aws-lambda": "^1.0.7",
"aws-serverless-express": "^3.4.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"cross-env": "^7.0.3",
"express": "^4.19.2",
"mongoose": "^8.4.1",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1"
Expand All @@ -39,24 +44,34 @@
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@swc/cli": "^0.3.14",
"@swc/core": "^1.6.5",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"copy-webpack-plugin": "^12.0.2",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"serverless": "^4.1.6",
"serverless-domain-manager": "^7.3.8",
"serverless-dotenv-plugin": "^6.0.0",
"serverless-offline": "^13.6.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"swc-loader": "^0.2.6",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3"
"typescript": "^5.1.3",
"webpack": "^5.92.1",
"webpack-cli": "^5.1.4"
},
"jest": {
"moduleFileExtensions": [
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports = {
libraryTarget: 'commonjs',
},
module: {
rules: [{ test: /\.ts$/, loader: 'ts-loader' }],
rules: [{ test: /\.ts$/, loader: 'swc-loader' }],
},
stats: {
warningsFilter: [
Expand Down

0 comments on commit 635ad53

Please sign in to comment.