Version control & collaboration (& more)
$ git clone https://github.com/vakila/selfie-cam
$ cd selfie-cam
$ git checkout -b bugfix
...edit files...
$ git add .
$ git commit -m "Fix that pesky bug"
$ git push -u origin bugfix
Syntax control & (some) bug catching
$ npm init @eslint/config
// package.json
// ...
"scripts": {
//...
"lint": "eslint ."
}
$ npm run lint
Style control & auto-formatting
$ npm install --save-dev --save-exact prettier
// package.json
// ...
"scripts": {
//...
"format": "prettier . --write"
}
$ npm run format
dev | "Move fast, break things" |
prod | Deliver a working site to real users |
dev | Builds targets newest browsersdev server watches for changes & reloads |
prod | Build targets wider range of browserspreview serves /dist , no updates |
We can customize:
dev
& preview
servers (e.g. port)// my-project/vite.config.js
import { defineConfig } from "vite"; // VSCode autocomplete
export default defineConfig({
base: "https://my.site.com/project/",
server: {
port: 1234,
},
build: {
target: [ "firefox78", "safari14" ],
},
//... lots of other options
});
Popular options:
+
+
equals...
setTimeout
, etc.)[Symbol.iterator]
, generators)import
/export