Skip to content

Latest commit

 

History

History
79 lines (55 loc) · 1.74 KB

log.md

File metadata and controls

79 lines (55 loc) · 1.74 KB

Logs

Setup TypeScript

  • Install typescript library
	npm i -D typescript
  • Configure TS options
	npx tsc --init
	"outDir": "./dist",
	"rootDir": "./src"

Setup Static Files

  • Create clean.js, clean-all.js and cp-statics.js scripts to copy statics files to dist folder
  • Create NPM Scripts to run project cleaner and builder
	npm i -D npm-run-all
	"build": "npm-run-all -s clean ts cp-statics",
    "ts": "tsc",
    "cp-statics": "node scripts/cp-statics.js",
    "clean": "node scripts/clean.js",
    "clean:all": "node scripts/clean-all.js"

Setup DevRunner

	npm install -D chokidar browser-sync
  • add watch.js script
  • Create NPM Scripts to run project watcher and server
	"dev": "npm run build && npm-run-all -p watch",
	"watch": "node scripts/watch.js",
	"serve": "browser-sync start --serve --files 'dist/*'"

Add AppRoot Component

  • create the first component to the project: <app-root></app-root> on index.ts and import it on index.html

Add Docker environment

  • create a Docker folder, to run code inner a container.
    • now you can run this project just installing Docker and running make docker-dev

Setup Webpack

  • add webpack and webpack-cli packages
  • create the webpack.config.js file
  • change scripts to extension *.mjs
  • separate static files to folder public and change it on scripts
  • create a second component to examplify component imports

Setup HTML imports

  • add typings/html.d.ts file
  • add an HTML import example on ExampleComponent