Skip to content

Instantly share code, notes, and snippets.

@mikeananev
Last active October 26, 2021 04:56
Show Gist options
  • Select an option

  • Save mikeananev/42b9d4b4ed48dd9283e37c5a6ce5b145 to your computer and use it in GitHub Desktop.

Select an option

Save mikeananev/42b9d4b4ed48dd9283e37c5a6ce5b145 to your computer and use it in GitHub Desktop.
New HTML/CSS project
import './index.css'
import moment from 'moment'
console.log("Hello from JavaScript!");
console.log(moment().startOf('day').fromNow());
New HTML/CSS project
0. mkdir `myweb01` folder, then `cd myweb01`
1. npm install -g vite; npm install -g vite-cli
2. npm init vite-app
3. Delete vue files
4. In package.json check:
"scripts": {
"dev": "vite",
"build": "vite build"
},
5. Place new html files in `public/` folder (it is root), despite index.html in the project root.
6. https://dev.to/alvarosaburido/getting-started-with-vite-2-1f4p
7. add js libraries to `main.js`. example (see below): npm install moment
8. `npm run dev` - for dev mode & hot reload
9. `npm run build` - for production build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment