P
Local bulletin
[!NOTE]
The project to be configured:
Value Note multi-stage-cd
Initialize the project
-
Make the directory
1 2
mkdir multi-stage-cd cd multi-stage-cd
-
Initialize git repo
1
git init
-
Install typescript and node env for ts
1
npm install typescript ts-node @types/node --save-dev
(
--save-devflag indicates that the packages are necessary for development purposes.) -
Configure
.gitignoreto prevent packages being added to git repo1
echo "node_modules/*" > .gitignore
-
Initalize ts project
1
tsc --init
Configure Jest test env
-
Install jest
1
npm install jest ts-jest @types/jest --save-dev
-
Configure jest
1
npx ts-jest config:init
-
Modify
tsconfig.json1 2 3 4 5 6 7 8 9 10 11 12
{ "compilerOptions": { "target": "ES6", "module": "commonjs", "strict": true, "esModuleInterop": true, "outDir": "./dist", "rootDir": "./src" }, "include": ["src/**/*.ts", "tests/**/*.ts"], "exclude": ["node_modules"] }