Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(worker): add swc compiler for the worker service #5375

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ RUN --mount=type=secret,id=BULL_MQ_PRO_NPM_TOKEN,uid=1000 export BULL_MQ_PRO_NPM

WORKDIR /usr/src/app/apps/worker

RUN cp src/.example.env dist/src/.env
RUN cp src/.env.test dist/src/.env.test
RUN cp src/.env.development dist/src/.env.development
RUN cp src/.env.production dist/src/.env.production
RUN cp src/.example.env dist/.env
RUN cp src/.env.test dist/.env.test
RUN cp src/.env.development dist/.env.development
RUN cp src/.env.production dist/.env.production

WORKDIR /usr/src/app

Expand Down
16 changes: 11 additions & 5 deletions apps/worker/nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,29 @@
"assets": [
{
"include": ".env",
"outDir": "dist/src"
"outDir": "dist"
},
{
"include": ".env.development",
"outDir": "dist/src"
"outDir": "dist"
},
{
"include": ".env.test",
"outDir": "dist/src"
"outDir": "dist"
},
{
"include": ".env.production",
"outDir": "dist/src"
"outDir": "dist"
}
],
"plugins": [],
"webpack": true
"builder": {
"type": "swc",
"options": {
"stripLeadingPaths": true
}
},
"typeCheck": true
},
"projects": {
"dal": {
Expand Down
2 changes: 2 additions & 0 deletions apps/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"@nestjs/cli": "^10.1.16",
"@nestjs/schematics": "^10.0.2",
"@nestjs/testing": "^10.2.2",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.4.12",
"@types/bcrypt": "^3.0.0",
"@types/chai": "^4.2.11",
"@types/express": "4.17.17",
Expand Down
4 changes: 3 additions & 1 deletion apps/worker/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const envFileMapper = {
};
const selectedEnvFile = envFileMapper[String(process.env.NODE_ENV)] || '.env';

const { error } = dotenv.config({ path: `${__dirname}/${process.env.E2E_RUNNER ? '..' : 'src'}/${selectedEnvFile}` });
const { error } = dotenv.config({
path: `${__dirname}/${process.env.E2E_RUNNER ? '..' : '..'}/${selectedEnvFile}`,
});

if (error && !process.env.LAMBDA_TASK_ROOT) throw error;

Expand Down
Loading
Loading