Skip to content

Commit

Permalink
doc update multiple config and examples sections
Browse files Browse the repository at this point in the history
  • Loading branch information
lhapaipai committed Aug 27, 2024
1 parent 930b3bd commit 11d8a53
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 19 deletions.
20 changes: 15 additions & 5 deletions docs/src/fr/guide/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,25 @@ C'est l'exemple qui présente la majorité des cas d'usage.
git clone https://github.com/lhapaipai/symfony-vite-dev.git
cd symfony-vite-dev

## Install vite-bundle/vite-plugin-symfony dependencies
## Installation des dépendances principales vite-bundle/vite-plugin-symfony
make install

## Install playgrounds (npm i/composer i for each of them)
make install-playgrounds
# si vous souhaitez tester un exemple en particulier
# - "basic" exemple principal
# - "stimulus-basic" pour stimulus seul
# - "stimulus" pour stimulus couplé avec Symfony UX
# - les autres exemples sont pour des cas spécifiques

cd playground/<your-playground>
symfony composer install

# Tester l'exemple basic
cd playground/basic
# démarrage de l'environnement de développement.
symfony local:server:start
npm run dev
# depuis votre navigateur rendez-vous sur : https://127.0.0.1:8000/

# si vous souhaitez installer tous les exemples en une fois
# - composer install
# - pnpm run build
make install-playgrounds
```
11 changes: 8 additions & 3 deletions docs/src/fr/guide/multiple-configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineConfig({
outDir: 'public/build-2',
rollupOptions: {
input: {
"multiple": "./assets/page/multiple/config2.js",
"other": "./assets/page/other/index.js",
},
},
},
Expand Down Expand Up @@ -103,15 +103,15 @@ dans vos modèles
```twig
{% block stylesheets %}
{# definissez le nom de votre config dans le 3e paramètre #}
{{ vite_entry_link_tags('multiple', [], 'config2') }}
{{ vite_entry_link_tags('other', [], 'config2') }}
{# pas de 3e paramètre, ce sera default_config -> config1 #}
{{ vite_entry_link_tags('welcome') }}
{% endblock %}
{% block javascripts %}
{# definissez le nom de votre config dans le 3e paramètre #}
{{ vite_entry_script_tags('multiple', [], 'config2') }}
{{ vite_entry_script_tags('other', [], 'config2') }}
{# pas de 3e paramètre, ce sera default_config -> config1 #}
{{ vite_entry_script_tags('welcome') }}
Expand Down Expand Up @@ -144,6 +144,11 @@ _pentatrion_vite_config2: // [!code ++]
configName: config2 // [!code ++]
requirements: // [!code ++]
path: ".+" // [!code ++]

_profiler_vite:
path: /_profiler/vite
defaults:
_controller: Pentatrion\ViteBundle\Controller\ProfilerController::info
```
## Configuration du composant Symfony Asset
Expand Down
24 changes: 16 additions & 8 deletions docs/src/guide/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ The [lhapaipai/symfony-vite-dev](https://github.com/lhapaipai/symfony-vite-dev)

```
.
├── extra
│ ├── symfony-vite-docs
│ ├── fast-bundle
│ └── fast-plugin-symfony
├── src
│ ├── vite-bundle
│ └── vite-plugin-symfony
├── node_modules
│ ├── acorn
│ ├── ...
Expand All @@ -34,17 +33,26 @@ This is the example that presents the majority of use cases.
git clone https://github.com/lhapaipai/symfony-vite-dev.git
cd symfony-vite-dev


## Install vite-bundle/vite-plugin-symfony dependencies
make install

# if you want to test the features in one playground
# - "basic" is the principal playground
# - "stimulus-basic" is for the core feature of stimulus
# - "stimulus" is for Symfony UX
# - other playgrounds are for specific use cases

cd playground/<your-playground>
symfony composer install

## Install playgrounds (npm i/composer i for each of them)
make install-playgrounds

# launch the development environment for the `basic` playground.
cd playground/basic
symfony local:server:start
npm run dev
# from your browser go to: https://127.0.0.1:8000/

# if you want to install all the playgrounds in one time (for each of them)
# - composer install
# - pnpm run build
make install-playgrounds
```
11 changes: 8 additions & 3 deletions docs/src/guide/multiple-configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default defineConfig({
outDir: 'public/build-2',
rollupOptions: {
input: {
"multiple": "./assets/page/multiple/config2.js",
"other": "./assets/page/other/index.js",
},
},
}
Expand Down Expand Up @@ -103,15 +103,15 @@ In your templates:
```twig
{% block stylesheets %}
{# define your config name in the 3rd parameter #}
{{ vite_entry_link_tags('multiple', [], 'config2') }}
{{ vite_entry_link_tags('other', [], 'config2') }}
{# no 3rd parameters it will be default_config -> config1 #}
{{ vite_entry_link_tags('welcome') }}
{% endblock %}
{% block javascripts %}
{# define your config name in the 3rd parameter #}
{{ vite_entry_script_tags('multiple', [], 'config2') }}
{{ vite_entry_script_tags('other', [], 'config2') }}
{# no 3rd parameters it will be default_config -> config1 #}
{{ vite_entry_script_tags('welcome') }}
Expand Down Expand Up @@ -144,6 +144,11 @@ _pentatrion_vite_config2: // [!code ++]
configName: config2 // [!code ++]
requirements: // [!code ++]
path: ".+" // [!code ++]

_profiler_vite:
path: /_profiler/vite
defaults:
_controller: Pentatrion\ViteBundle\Controller\ProfilerController::info
```
## Symfony Asset component configuration
Expand Down

0 comments on commit 11d8a53

Please sign in to comment.