Jamie-Yang/vue3-boilerplate
About
A Vue 3 starter with Vue Router 5, Pinia 4, TypeScript 6, Webpack 5 and More.
Web & App DevelopmentMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalvue3-boilerplate
A Vue 3 starter with Vue Router 5, Pinia 4, TypeScript 6 and Webpack 5.
Requirements
- Node.js
^22.18.0 || >=24.11.0 - pnpm 10
Getting started
pnpm install --frozen-lockfile
pnpm dev
The development server listens on port 8080 by default.
Commands
| Command | Description |
|---|---|
pnpm dev |
Start the development server. |
pnpm build |
Type-check and build to dist/, removing stale output files on emit. |
pnpm type-check |
Check TypeScript and Vue files without generating a bundle. |
pnpm lint |
Run Prettier, ESLint and Stylelint with formatting and automatic fixes. |
Project structure
├─ public # Static files copied to the output directory.
├─ service
│ ├─ commands # Development and build entry points.
│ ├─ config # Webpack configuration.
│ └─ project.config.js # Port, public paths and output directory.
├─ src
│ ├─ assets # Shared images, fonts and styles.
│ ├─ components # Shared Vue components.
│ ├─ router # Routes; uses hash history.
│ ├─ stores # Pinia stores.
│ └─ views # Pages and their local components and assets.
The @/ import alias points to src/.
Configuration
- Set the development port, development/production public paths and output directory in
service/project.config.js. - Configure target browsers in
.browserslistrc. - Static files belong in
public/;public/index.htmlis the HTML template.
Environment variables
.envcontains shared values..env.developmentand.env.productioncontain values for their respective commands..env.localand.env.<mode>.localcontain local overrides and are ignored by Git.- Existing environment variables take precedence, except for the command-controlled
NODE_ENVandBABEL_ENVvalues described below. File values take precedence in this order:.env.<mode>.local,.env.<mode>,.env.local,.env.
Variables prefixed with VUE_APP_ are embedded in client code and can be read through process.env.VUE_APP_*. Do not put secrets in these variables. NODE_ENV and PUBLIC_PATH are also available in client code.
const apiBaseUrl = process.env.VUE_APP_API_BASE_URL
pnpm dev sets NODE_ENV and BABEL_ENV to development; pnpm build sets them to production.
Restart the development server after changing environment files or build configuration.
Explore related projects
Loading…