-
Notifications
You must be signed in to change notification settings - Fork 11
Translation of all api/internals-*.md
files
#30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
--- | ||
title: "API: The Builder Class" | ||
description: Nuxt Builder Class | ||
title: "API : La classe Builder" | ||
description: La classe `Builder` de Nuxt | ||
--- | ||
|
||
# Builder Class (En) | ||
# Classe Builder | ||
|
||
- Source: **[builder/builder.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/builder/builder.js)** | ||
- Source : **[builder/builder.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/builder/builder.js)** | ||
|
||
|
||
## Tapable plugins | ||
## Plugins Tapable | ||
|
||
<p style="width: 294px;position: fixed; top : 64px; right: 4px;" class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/nuxt" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>We can register hooks on certain life cycle events.</p> | ||
Nous pouvons enregistrer des points d'ancrage sur certains évènements du cycle de vie. | ||
|
||
```js | ||
nuxt.plugin('build', builder => { | ||
|
@@ -20,12 +20,12 @@ nuxt.plugin('build', builder => { | |
}) | ||
``` | ||
|
||
Plugin | Arguments | When | ||
---------------------|-----------------------------------------|-------------------------------------------------------------------------------- | ||
`build` | builder | First build started | ||
`built` | builder | First build finished | ||
`extendRoutes` | {routes, templateVars, r} | Generating routes | ||
`generate` | {builder, templatesFiles, templateVars} | Generating `.nuxt` template files | ||
`done` | {builder, stats} | Webpack build was done | ||
`compile` | {builder, compiler} | Before webpack compile (compiler is a MultiCompiler instance) | ||
`compiled` | builder | Webpack build finished | ||
Plugin | Arguments | When | ||
---------------|-----------------------------------------|------------------------------------------------------------------------------- | ||
`build` | builder | Au démarrage du premier build | ||
`built` | builder | À la fin du premier build | ||
`extendRoutes` | {routes, templateVars, r} | À la génération des routes | ||
`generate` | {builder, templatesFiles, templateVars} | À la génération des fichiers template `.nuxt` | ||
`done` | {builder, stats} | Quand les build webpack sont fini | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "sont finis" |
||
`compile` | {builder, compiler} | Avant la compilation webpack (le compilateur est une instance `MultiCompiler`) | ||
`compiled` | builder | À la fin du build webpack |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
--- | ||
title: "API: The Generator Class" | ||
description: Nuxt Generator Class | ||
title: "API : La classe Generator" | ||
description: Le classe `Generator` de Nuxt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Le classe => *La classe |
||
--- | ||
|
||
# Generator Class (En) | ||
# La classe Generator | ||
|
||
- Source: **[builder/generator.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/builder/generator.js)** | ||
- Source : **[builder/generator.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/builder/generator.js)** | ||
|
||
|
||
## Tapable plugins | ||
## Plugins | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Plugins => Plugins Tapable
|
||
|
||
<p style="width: 294px;position: fixed; top : 64px; right: 4px;" class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/nuxt" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>We can register hooks on certain life cycle events.</p> | ||
Nous pouvons enregistrer des points d'ancrage sur certains évènements du cycle de vie. | ||
|
||
```js | ||
nuxt.plugin('generator', generator => { | ||
|
@@ -20,7 +20,7 @@ nuxt.plugin('generator', generator => { | |
}) | ||
``` | ||
|
||
Plugin | Arguments | When | ||
---------------------|-----------------------------------------|-------------------------------------------------------------------------------- | ||
`generateRoutes` | {generator, generateRoutes} | After resolving routes to generate so we have change to customize them | ||
`generate` | {generator, routes} | Just before start generating routes. routes are decorated with payloads | ||
Plugin | Arguments | When | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When => Quand |
||
-----------------|-----------------------------|------------------------------------------------------------------------------------------------- | ||
`generateRoutes` | {generator, generateRoutes} | Après la résolution des routes pour généreration afin de faire des changements personnalisés | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "génération" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Il était pas génial mon « généreration » :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😂 |
||
`generate` | {generator, routes} | Avant le démarrage de la génération des routes. Les routes sont décorées avec des charges utiles |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,78 @@ | ||
--- | ||
title: "API: The ModuleContainer Class" | ||
description: Nuxt ModuleContainer Class | ||
title: "API : La classe ModuleContainer" | ||
description: La classe `ModuleContainer` de Nuxt | ||
--- | ||
|
||
# ModuleContainer Class (En) | ||
# Classe ModuleContainer | ||
|
||
- Source: **[core/module.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/core/module.js)** | ||
- Source : **[core/module.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/core/module.js)** | ||
|
||
<p style="width: 294px;position: fixed; top : 64px; right: 4px;" class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/nuxt" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>All [modules](/guide/modules) will be called within context of ModuleContainer instance.</p> | ||
Tous les [modules](/guide/modules) seront appelé dans le contexte de l'instance de `ModuleContainer`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seront appelé =>seront appelés |
||
|
||
## Tapable plugins | ||
## Plugins Tapable | ||
|
||
We can register hooks on certain life cycle events. | ||
Nous pouvons enregistrer des points d'ancrage sur certains évènements du cycle de vie. | ||
|
||
```js | ||
nuxt.moduleContainer.plugin('ready', async moduleContainer => { | ||
// Do this after all modules where ready | ||
// Faire ceci après que tous les modules soient prèts | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "prêts" |
||
}) | ||
``` | ||
|
||
Inside [modules](/guide/modules) context we can use this instead: | ||
Dans le contexte des [modules](/guide/modules) nous pouvons utiliser ceci à la place : | ||
|
||
```js | ||
this.plugin('ready', async moduleContainer => { | ||
// Do this after all modules where ready | ||
// Faire ceci après que tous les modules soient prèts | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "prêts" |
||
}) | ||
``` | ||
|
||
Plugin | Arguments | When | ||
---------------------|---------------------------|-------------------------------------------------------------- | ||
`ready` | moduleContainuer | All modules in `nuxt.config.js` has been initialized | ||
Plugin | Arguments | When | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When => Quand |
||
--------|-----------------|----------------------------------------------------------- | ||
`ready` | moduleContainer | Tous les modules dans `nuxt.config.js` ont été initialisés | ||
|
||
|
||
## Methods | ||
## Méthodes | ||
|
||
### addVendor (vendor) | ||
Adds to `options.build.vendor` and apply unique filter. | ||
|
||
Ajouter à `options.build.vendor` et appliquer un filtre unique. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ajouter à |
||
|
||
### addTemplate (template) | ||
- **template**: String Or Object | ||
- src | ||
- options | ||
- fileName | ||
|
||
Renders given template using [lodash template](https://lodash.com/docs/4.17.4#template) during build into project `buildDir` (`.nuxt`). | ||
- **template**: `String` ou `Object` | ||
- `src` | ||
- `options` | ||
- `fileName` | ||
|
||
Le rendu des templates sont fait dans le projet `buildDir` (`.nuxt`) en utilisant [lodash template](https://lodash.com/docs/4.17.4#template). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "sont faits" |
||
|
||
If `fileName` is not provided or template is string, target file name defaults to `[dirName].[fileName].[pathHash].[ext]` | ||
Si n'est pas fourni ou que `template` est une chaine de caractères, le fichier ciblé par défaut sera `[dirName].[fileName].[pathHash].[ext]`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Si n'est pas fourni => Si `fileName' n'est pas fourni
|
||
|
||
This method returns final `{ dist, src, options }` object. | ||
Cette méthode retourne un objet final `{ dist, src, options }`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. un objet final
|
||
|
||
### addPlugin (template) | ||
|
||
Registers a plugin using `addTemplate` and adds it to first of `plugins[]` option. | ||
You can use `template.ssr: false` to disable plugin including in SSR bundle. | ||
Enregistrer un plugin en utilisant `addTemplate` et l'ajouter en premier à la liste des options de `plugins[]`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enregistrer un plugin en utilisant => Enregistre un plugin en utilisant et l'ajouter en premier à la liste => et l'ajoute en premier à la liste |
||
|
||
Vous pouvez utiliser `template.ssr: false` pour désactiver les plugins inclus dans le paquetage SSR. | ||
|
||
### addServerMiddleware (middleware) | ||
|
||
Pushes middleware into [options.serverMiddleware](/api/configuration-servermiddleware). | ||
Pousse le middleware dans [options.serverMiddleware](/api/configuration-servermiddleware). | ||
|
||
### extendBuild (fn) | ||
|
||
Allows easily extending webpack build config by chaining [options.build.extend](/api/configuration-build#extend) function. | ||
Permet d'étendre facilement la configuration de build webpack en chainant la fonction [options.build.extend](/api/configuration-build#extend). | ||
|
||
### extendRoutes (fn) | ||
|
||
Allows easily extending routes by chaining [options.build.extendRoutes](/api/configuration-router#extendroutes) function. | ||
Permet d'étendre facilement les routes en chainant la fonction [options.build.extendRoutes](/api/configuration-router#extendroutes). | ||
|
||
### addModule (moduleOpts, requireOnce) | ||
### addModule (moduleOpts, requireOnce) | ||
|
||
Registers module. moduleOpts can be string or `[src, options]`. | ||
If `requireOnce` is `true` and resolved module exports `meta` prevents registering same module twice. | ||
Enregistre le module. `moduleOpts` peut être une chaine de caractères ou `[src, options]`. Si `requireOnce` est `true`, les modules résolues `meta` préviennent l'enregitrement du même module plus d'une fois. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "les modules résolus" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "l'enregistrement" |
||
|
||
### requireModule (moduleOpts) | ||
|
||
Is shortcut to `addModule(moduleOpts, true)` | ||
C'est un alias raccourci de `addModule(moduleOpts, true)` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
--- | ||
title: "API: The Nuxt Class" | ||
description: Nuxt Core Class | ||
title: "API : La classe Nuxt" | ||
description: La classe cœur Nuxt | ||
--- | ||
|
||
# Nuxt Class (En) | ||
# La classe Nuxt | ||
|
||
- Source: **[core/nuxt.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/core/nuxt.js)** | ||
- Source : **[core/nuxt.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/core/nuxt.js)** | ||
|
||
<p style="width: 294px;position: fixed; top : 64px; right: 4px;" class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/nuxt" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>This is the core container which allows all modules and classes communicate with each other. | ||
All modules has access to nuxt instance using `this.nuxt`.</p> | ||
C'est le conteneur cœur qui permet à tous les modules et classes de communiquer les uns avec les autres. Tous les modules ont accès à l'instance de Nuxt en utilisant `this.nuxt`. | ||
|
||
## Tapable plugins | ||
## Plugins Tapable | ||
|
||
We can register hooks on certain life cycle events. | ||
Nous pouvons enregistrer des points d'ancrage sur certains évènements du cycle de vie. | ||
|
||
```js | ||
nuxt.plugin('ready', async nuxt => { | ||
// Your custom code here | ||
// Votre code personnalisé ici | ||
}) | ||
``` | ||
|
||
Plugin | Arguments | When | ||
--------------|------------------------|-------------------------------------------------------------------------------- | ||
`ready` | nuxt | All modules initialized and before initializing renderer | ||
`error` | error args | An unhandled error by one of nuxt modules caught | ||
`close` | - | Nuxt instance is gracefully closing | ||
`listen` | ({server, host, port}) | Nuxt **Internal** server starts listening. (Using `nuxt start` or `nuxt dev`) | ||
Plugin | Arguments | When | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When => Quand |
||
---------|------------------------|----------------------------------------------------------------------------------------- | ||
`ready` | nuxt | Après l'initialisation de tous les modules et avant l'initialisation du moteur de rendu | ||
`error` | error args | Une erreur non gérée par un des modules Nuxt attrapée | ||
`close` | - | L'instance de Nuxt est gracieusement fermée | ||
`listen` | ({server, host, port}) | Les **mécanismes** serveur de Nuxt commence à écouter. (Avec `nuxt start` ou `nuxt dev`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "commencent" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
--- | ||
title: "API: The Renderer Class" | ||
description: Nuxt Renderer Class | ||
title: "API : La classe Renderer" | ||
description: La classe `Renderer` de Nuxt | ||
--- | ||
|
||
# Renderer Class (En) | ||
# Classe `Renderer` | ||
|
||
- Source: **[core/renderer.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/core/renderer.js)** | ||
- Source : **[core/renderer.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/core/renderer.js)** | ||
|
||
<p style="width: 294px;position: fixed; top : 64px; right: 4px;" class="Alert Alert--orange"><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/nuxt" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>This class is exporting a connect middleware which handles and serves all SSR and asset requests.</p> | ||
Cette classe exporte un middleware exportée qui gère et sert tous les rendus côté serveur et les requêtes de ressources. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Il y a deux fois exporter dans ta phrase; c'est normal? |
||
|
||
## Tapable plugins | ||
## Plugins Tapable | ||
|
||
We can register hooks on certain life cycle events. | ||
Nous pouvons enregistrer des points d'ancrage sur certains évènements du cycle de vie. | ||
|
||
```js | ||
nuxt.plugin('renderer', renderer => { | ||
renderer.plugin('setupMiddleware', app => { | ||
// | ||
// ... | ||
}) | ||
}) | ||
``` | ||
|
||
Plugin | Arguments | When | ||
---------------------|---------------------------|-------------------------------------------------------------------------------- | ||
`ready` | renderer | SSR Middleware and all resources are ready | ||
`setupMiddleware` | connect instance (app) | Before nuxt adds it's middleware stack. We can use it to register custom server side middleware. | ||
Plugin | Arguments | When | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When => Quand |
||
------------------|------------------------|--------------------------------------------------------------------------------------------------------------------------------- | ||
`ready` | renderer | Le rendu serveur du middleware et toutes les ressources sont prêtes | ||
`setupMiddleware` | connect instance (app) | Avant que Nuxt ajoute sa pile de middleware. Nous pouvons l'utiliser pour enregistrer des middlewares côté serveur personnalisés |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When => Quand