Skip to content

Commit 4c70bd3

Browse files
committed
Initial work on a page explaining the project structure
1 parent 59794f1 commit 4c70bd3

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

packages/docs/.vitepress/config.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ export default defineConfigWithTheme({
5757
text: 'Deeper dive',
5858
items: [
5959
{
60+
text: 'Why does it... ?',
61+
link: '/why'
62+
}, {
6063
text: 'Files in <code>dist</code>',
6164
link: '/dist-files'
6265
}, {

packages/docs/src/why.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Why does it... ?
2+
3+
You might have a lot of questions about why the generated project is structured the way it is. This page aims to answer some of those questions.
4+
5+
:::tip NOTE
6+
More content should be added to this page over time, there's a lot to explain.
7+
:::
8+
9+
To learn more about the built files in the `dist` directory see [Files in `dist`](dist-files).
10+
11+
## Influences
12+
13+
Much of the configuration is based on [`create-vue`](https://github.com/vuejs/create-vue). Sticking close to that tool makes it easier for everyone involved.
14+
15+
But applications and libraries need different things.
16+
17+
Libraries such as [Vue core](https://github.com/vuejs/core), [Vue Router](https://github.com/vuejs/router) and [Pinia](https://github.com/vuejs/pinia/) have also heavily influenced the project structure used by this tool, especially the use of a `packages` directory and pnpm workspaces. Various other tools, such as `simple-git-hooks`, `lint-staged` and VitePress, have been chosen to align with those projects.
18+
19+
Those projects use [rollup](https://rollupjs.org/) directly for their builds, rather than Vite. Using rollup is more flexible, but using Vite has a few advantages:
20+
21+
- Vite is familiar to most members of the Vue community.
22+
- Using Vite keeps us closer to `create-vue`.
23+
- Vite has its own ecosystem of useful plugins.
24+
25+
In particular, the libraries mentioned above don't use `.vue` files in their source code. Compiling `.vue` files with rollup is certainly possible, but it's more convenient to reuse the same toolchain used to build Vue applications.
26+
27+
<!--
28+
29+
## ESLint configuration
30+
31+
## TypeScript configuration
32+
33+
## `simple-git-hooks` and `lint-staged`
34+
35+
## Vite configuration
36+
37+
## `__DEV__` and `__TEST__`
38+
39+
-->

0 commit comments

Comments
 (0)