Quickly create HTML projects for mobile devices, and develop with live reload.
before first use, install html5-cli
globally (only need once):
npm i -g html5-cli
Then you can use h5
or html5
command in your terminal to create a new project.
# replace <project-name> with actually project name (you can also use `html5` in place of `h5`, there two commands are the same)
h5 init <project-name>
Then you will be prompted to choose a template you want to use. Currently, there are two templates.
This template is raw enough with only some raw html, css and js files. No building tools like webpack or vite is used.
If you want to develop with live reload, you can use the html5 build
command which is described later.
This template is out of the box with the following features:
- Vue3 + Vite4
- TypeScript
- Vant4 UI Library
- Tailwindcss: utility-first CSS framework
- Use Pinia for state management
- Support dark theme mode
- Vue-router 4
- Support automatically register components for SVG icons
- adaptive for vw viewport design
- make request with Axios
- support gzip compression
- support mocking data for development environment
- ESLint
- First screen loading animation
- Debug in development environment with Eruda
- Support take advantage of CDN in production environment
If you are using the classic
template, or any other HTML projects without building tools like webpack or vite, you can use html5-cli
to provide the live reload ability, making developing a pleasure.
# enter project and then execute the command below, default server port is 8080
html5 build
# or you can specify the port
html5 build --port 8081
Changes to any files whose file name is not ending with .min.js
or .min.css
will trigger HTML files visited in browser to be refreshed automatically.
Licensed under the MIT license.