Closed agorina closed 4 years ago
I found the solution. Thank you.
Great!
@agorina what was the solution?
It was a while ago, so I do not remember what exactly solved it, but here is our new set up:
Project folder structure:
- build
Lsrc
- config
- src
``
tsconfig.json
{ "compilerOptions": { "target": "ES2019", "module": "commonjs", "resolveJsonModule": true, "allowJs": true, "sourceMap": true, "outDir": "build", "esModuleInterop": true, "experimentalDecorators": true, "declaration": true, "moduleResolution": "node", "noEmitOnError": true, "importHelpers": true, "noImplicitAny": false, "strict": true, "strictNullChecks": true, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, "composite": true }, "include": [ "src/*/", "test/*/", "config/Config.d.ts" ], "exclude": [ "node_modules" ] }
package.json
"scripts": { "config": "node-config-ts", "copy:sql": "cpy '*/.sql.yaml' '../build/src/' --cwd=src --parents", "lint": "npx eslint .", "coverage": "nyc --reporter=text npm test", "coverage:ci": "nyc --temp-dir=./coverage-report/raw --reporter=cobertura --report-dir=./coverage-report npm run test:ci", "test": "mocha --recursive --require ts-node/register --require dotenv/config --colors test/*/.ts --dbConfig.database=faro_db_test --auth.enable=false --auth.mockUser.id=123 --auth.mockUser.tenant=sample_tenant", "test:ci": "mocha --timeout 12000 --recursive --require ts-node/register --require dotenv/config --reporter mocha-junit-reporter --reporter-options mochaFile=./test-output/test-results.xml", "start": "node --max-http-header-size=16000 ./build/src/server.js", "start:dev": "tsc-watch --onSuccess \"node --max-http-header-size=16000 --require dotenv/config ./build/src/server.js\"", "build": "tsc && npm run copy:sql && rm -rf ./build/test", "release:patch": "npm version patch -m \"Upgrade to %s during CI [skip ci]\" --force " },
...
"files": [
"/build",
"/config"
],
And it all works now. Hope this helps.
I am new to the node/ts development, and I am trying to set up a project that run on Azure app server. It expects all the distribution files packaged in the
dist
folder. Here is my local set up and it all works well, but it does not when it gets published to the Azure because config folder is not picked up:My tsconfig:
and package.json
Any help is very much appreciated.