Simple setup to get quick and fast going with the help of Parcel.
- Create a package.json and paste the following in:
{
"name": "prototype",
"scripts": {
"start": "npm run clean && parcel serve src/index.html",
"build": "npm run clean && parcel serve src/index.html",
"clean": "rimraf dist"
},
"devDependencies": {
"parcel": "^1.12.4",
"rimraf": "^3.0.2",
"typescript": "^3.9.5"
},
"dependencies": {
"core-js": "^3.6.5"
}
}
- Create de entry files like the
src/index.html
andsrc/main.ts
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>prototype</title>
</head>
<body>
<script src="./main.ts"></script>
</body>
</html>
import "core-js";
// code goes here
- Some commands to run the server
npm run start # start the dev server
npm run build # creates a production ready build
npm run clean # clean up the dist folder