mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
More config to get relative imports working in backend
This commit is contained in:
committed by
Alec LaLonde
parent
6c30c38915
commit
cf1e099d56
@@ -51,7 +51,9 @@ COPY --from=build /usr/src/app/package.json ./package.json
|
||||
COPY --from=build /usr/src/app/node_modules ./node_modules
|
||||
|
||||
COPY --from=build /usr/src/app/packages/backend/package.json ./packages/backend/package.json
|
||||
COPY --from=build /usr/src/app/packages/backend/tsconfig-paths-bootstrap.js ./packages/backend/tsconfig-paths-bootstrap.js
|
||||
COPY --from=build /usr/src/app/packages/backend/dist ./packages/backend/dist
|
||||
COPY --from=build /usr/src/app/packages/backend/node_modules ./packages/backend/node_modules
|
||||
|
||||
COPY --from=build /usr/src/app/packages/utils/package.json ./packages/utils/package.json
|
||||
COPY --from=build /usr/src/app/packages/utils/dist ./packages/utils/dist
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"start": "node ./dist/index.js",
|
||||
"start": "node -r ./tsconfig-paths-bootstrap.js ./dist/index.js",
|
||||
"build": "yarn generate && tsc -b",
|
||||
"dev": "concurrently \"yarn dev-ts\" \"yarn generate --watch\"",
|
||||
"dev-ts": "ts-node-dev --exit-child --respawn -r tsconfig-paths/register -- src/index.ts",
|
||||
"dev-ts": "ts-node-dev --exit-child --respawn -r tsconfig-paths/register --inspect=0.0.0.0:4322 -- src/index.ts",
|
||||
"typecheck": "yarn build",
|
||||
"precommit": "yarn lint-staged",
|
||||
"generate": "graphql-codegen --config=codegen.yml",
|
||||
@@ -46,6 +46,7 @@
|
||||
"node-fetch": "3.2.1",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"sourcecred": "0.11.0",
|
||||
"tsconfig-paths": "^4.0.0",
|
||||
"uuid": "8.3.2",
|
||||
"web3.storage": "3.5.6"
|
||||
},
|
||||
@@ -54,7 +55,6 @@
|
||||
"@types/body-parser": "1.19.2",
|
||||
"@types/cors": "2.8.12",
|
||||
"nock": "13.2.4",
|
||||
"ts-node-dev": "1.1.8",
|
||||
"tsconfig-paths": "^4.0.0"
|
||||
"ts-node-dev": "1.1.8"
|
||||
}
|
||||
}
|
||||
|
||||
15
packages/backend/tsconfig-paths-bootstrap.js
Normal file
15
packages/backend/tsconfig-paths-bootstrap.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
This is a custom configuration for tsconfig-paths to be able to "fix"
|
||||
relative paths at runtime (in node.js) in the Docker container. tsconfig-paths
|
||||
"just works" for local dev, but this extra configuration is necessary when
|
||||
running in Docker since at that point we're just running the transpiled
|
||||
javascript in the dist directory.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const tsConfigPaths = require('tsconfig-paths');
|
||||
|
||||
tsConfigPaths.register({
|
||||
baseUrl: 'dist',
|
||||
paths: {},
|
||||
});
|
||||
Reference in New Issue
Block a user