Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,25 @@ await this.loadExtend('application', app);

### LoaderOptions

`LoaderOptions` accepts a `loaderFS` option for advanced loader integrations.
The value must implement the exported `LoaderFS` interface. When omitted by
`loadToApp` or `loadToContext`, it reuses the current loader's `loaderFS`
instance. `EggLoader` defaults that instance to `RealLoaderFS`, the default
`@eggjs/core` loader filesystem implementation.

| Param | Type | Description |
| ----------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- |
| ----------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| directory | `String/Array` | directories to be loaded |
| target | `Object` | attach the target object from loaded files |
| match | `String/Array` | match the files when load, default to `**/*.js`(if process.env.EGG\*TYPESCRIPT was true, default to `[ '\*\*/\_.(js | ts)', '!\*_/_.d.ts' ]`) |
| match | `String/Array` | match the files when load, default to `**/*.js` (if TypeScript support is enabled, default to <code>['**/*.(js&#124;ts)', '!**/*.d.ts']</code>) |
| ignore | `String/Array` | ignore the files when load |
| initializer | `Function` | custom file exports, receive two parameters, first is the inject object(if not js file, will be content buffer), second is an `options` object that contain `path` |
| caseStyle | `String/Function` | set property's case when converting a filepath to property list. |
| override | `Boolean` | determine whether override the property when get the same name |
| call | `Boolean` | determine whether invoke when exports is function |
| inject | `Object` | an object that be the argument when invoke the function |
| filter | `Function` | a function that filter the exports which can be loaded |
| loaderFS | `LoaderFS` | custom loader-facing filesystem implementation, defaults to the loader's `loaderFS` |

## Timing

Expand Down