Use vite-node
as the Javascript runtime. Read more.
This repository serves as a template, and I will rebase it over time to make updates as needed.
- Uses Vitest for testing
- Uses ESLint with Antfu's config
- Uses Release-it for releasing
To start a new project, run
degit acfatah/vite-javascript your_project
After that, install the dependencies and initialize a new git repository by running the following command.
npm install && git init
To start development mode using vitest
, run
npm run dev
To run the program, use the npm run start
command or simple press F5 in vscode.
To run vite-node
directly using bash, run the command bin/run
. You may need to install vite-node
globally.
To build the source to be compatible with nodejs v14, run npm run build
.
The source will be built in dist
directory. The script can be executed by
running node dist/main.js
.
- Update relevant information in
package.json
- Update
vite.config.js
- Update
LICENCE
- Update
README.md
- Initialize new git repository
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run start |
Run the code |
npm run dev |
Starts development mode |
npm run build |
Transpile code to ./dist/ directory |
npm run lint |
Run code linter on the project directory |
npm run lint:fix |
Apply available code fixes using the linter |
npm run test |
Run test once with code coverage analysis |
npm run update |
Update dependencies according to semver |
npm run release |
Release the code on npm |