Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy Brauner committed Nov 17, 2022
1 parent 72ae8d5 commit 4d09676
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions docs/02.vite-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,12 @@ This one supports the dev-server, HMR and transformation & compilation.
Vite's configuration is managed by two main files:

- [vite.config.ts](vite.config.ts): contains the whole vite config [(vite config documentation)](https://vitejs.dev/config/)
- [vite.scripts.config.ts](vite.scripts.config.ts): contains the whole vite scripts config. It built scripts files relative to the SSR and SSG part.
- [config/config.js](config/config.js): is the internal paths and tasks config file.

### <a name="Entrypoints"></a>Entry points

By default, the single application entrypoint is [src/index.tsx](src/index-client.tsx). It initializes a react App.
But this file can be changed as `index.ts` or `index.js`. In case this filename or type change, [config/config.js](config/config.js)
`input` array need to be modified.
Two entry points are set:

```js
input: [
"src/index.tsx", // -> ex: modified as 'src/main.js'
]
```

Being an array, it is possible to define several application entry points.

```js
input: ["src/main.ts", "src/second.ts"]
```

The default [base.twig](dist/front/www/views/layouts/base.twig) template,
is configured to add as script each input entrypoint automatically.
- server side [src/index-server.tsx](src/index-server.tsx)
- client side [src/index-client.tsx](src/index-client.tsx)

0 comments on commit 4d09676

Please sign in to comment.