This is a coutry list project created in vanila JS + TS
##To initial existing code:
- Install Node 8 or newer.
- Navigate to this project's root directory on the command line.
- Install Node Packages. -
npm install
##To create project step by step by yourself:
- Initialize node project=> npm init --y
- Instal typescript =>
npm i --save-dev typescript
- Add start script to packeage.json=>
"start" :"tsc -watch"
- Configure tsconfig.json file (ex. add "outDir":"./dist")
- Create empty file and create index.html file, src directory and script.ts file
- Connect dest file with html=>
<script src="dest/script.js" defer></script>
If you want to use a boundler follow the next steps:
a) Install your boundler: npm install --save-dev parcel
b) Add script and source to packeage.json=> "source":"index.html", "main": "index.js", "scripts": { "start":parcel"
},
c) Update/change point 6 with <script type="module" src="src/script.ts" defer></script>
d) Update tsconfig.json=> "module":"es6"
After that run your webapp in terminal=> nmp start
Dependency | Use |
---|---|
uuid | Utilities to create unique id |
Dependency | Use |
---|---|
@types/uuid | Utilities to create unique id |
parcel | Bundler |
typescript | Syntactic supset of Java Script |