Similar templates.
Separate copies? No!
Maintain shared code once. Describe the differences in a preset, then select files and apply changes when creating each project.
src/main.ts
src/analytics.ts
package.json
basic.json
Basic edition
src/main.ts
src/analytics.ts −
team.json
Team edition
src/main.ts
src/analytics.ts
SOURCE → PRESET → PROJECT
Less repetition in your workflow
Choose a scenario to see what happens to the files.
Almost identical templates, maintained separately?
Manual upkeepKeep separate copies for basic and team editions. Check and fix the same code in every copy.
With Create PresetKeep one source. Describe the file and config differences in presets and generate the edition needed.
Source files
- starter/src/main.tsEdited
- starter/src/analytics.tsExcluded
- starter/package.jsonEdited
import { track } from './analytics'
track('app-started')
console.log('Hello')
Preset rules
{
"source": {
"directory": "starter"
},
"exclude": [
"src/analytics.ts"
],
"replace": [
{
"path": "src/main.ts",
"from": "import { track } from './analytics'\n\ntrack('app-started')\n",
"to": ""
}
]
}
Generated files
2 files- src/main.tsEdited
- package.jsonEdited
console.log('Hello')
pnpm create preset init my-basic-app --from ./presets/basic.jsonFictional repository · Commands are not run in the browser
Explore the examplePracticality
Supports everything from starter templates to complex projects.
Efficient
Reduces repetitive configuration processes every time a new project is created.
Interactive
Simple command-line interactive operation.
Multi-Tech Stacks
Provide commonly used multiple technology stack project support.
Project customization
Use the same template to create projects with different configurations.
Private Configuration
Manage private project sources in a local config.
Try it out
Run one of the following commands and follow the prompts.
pnpm create presetA look at the CLI
Vue offers the official Vue starter and Nuxt.
$ pnpm create preset
create-preset
Create projects with official generators and declarative presets.
Project name: my-preset-app
Select a tech stack: Vue
Select a preset:
❯ Official Vue Starter ↗
Nuxt ↗