mirror of
https://github.com/flarum/core.git
synced 2025-08-10 10:24:46 +02:00
feat: export registry (#3842)
* feat: registry first iteration Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> * feat: improve webpack auto export loader Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> * chore: remove `compat` API Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> * chore: cleanup Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> --------- Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
@@ -31,27 +31,3 @@ Add another build script to your `package.json` like the one below:
|
||||
You'll need to configure a `tsconfig.json` file to ensure your IDE sets up Typescript support correctly.
|
||||
|
||||
For details about this, see the [`flarum/flarum-tsconfig` repository](https://github.com/flarum/flarum-tsconfig)
|
||||
|
||||
## Options
|
||||
|
||||
### `useExtensions`
|
||||
|
||||
`Array<string>`, defaults to `[]`.
|
||||
|
||||
An array of extensions whose modules should be made available. This is a shortcut to add [`externals`](https://webpack.js.org/configuration/externals/) configuration for extension modules. Imported extension modules will not be bundled, but will instead refer to the extension's exports included in the Flarum runtime (ie. `flarum.extensions["vendor/package"]`).
|
||||
|
||||
For example, to access the Tags extension module within your extension:
|
||||
|
||||
**forum.js**
|
||||
|
||||
```js
|
||||
import { Tag } from '@flarum/tags/forum';
|
||||
```
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = config({
|
||||
useExtensions: ['flarum/tags'],
|
||||
});
|
||||
```
|
||||
|
Reference in New Issue
Block a user