Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,35 @@ constructor(options: ExternalsLoadingPluginOptions);

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| options | [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) | |
<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

options


</td><td>

[ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md)


</td><td>


</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,37 @@ apply(compiler: Compiler): void;

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| compiler | Compiler | |
<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

compiler


</td><td>

Compiler


</td><td>


</td></tr>
</tbody></table>

**Returns:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,67 @@ export default {

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(options)](./externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md) | | Constructs a new instance of the <code>ExternalsLoadingPlugin</code> class |
<table><thead><tr><th>

Constructor


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[(constructor)(options)](./externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md)


</td><td>


</td><td>

Constructs a new instance of the `ExternalsLoadingPlugin` class


</td></tr>
</tbody></table>

## Methods

| Method | Modifiers | Description |
| --- | --- | --- |
| [apply(compiler)](./externals-loading-webpack-plugin.externalsloadingplugin.apply.md) | | |
<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[apply(compiler)](./externals-loading-webpack-plugin.externalsloadingplugin.apply.md)


</td><td>


</td><td>


</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) &gt; [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) &gt; [globalObject](./externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md)

## ExternalsLoadingPluginOptions.globalObject property

This option indicates what global object will be used to mount the library.

In Lynx, the library will be mounted to `lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")]` by default.

If you have enabled share js context and want to reuse the library by mounting to the global object, you can set this option to `'globalThis'`<!-- -->.

'lynx'

**Signature:**

```typescript
globalObject?: 'lynx' | 'globalThis' | undefined;
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,127 @@ export interface ExternalsLoadingPluginOptions

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [backgroundLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.backgroundlayer.md) | | string | The name of the background layer. |
| [externals](./externals-loading-webpack-plugin.externalsloadingpluginoptions.externals.md) | | Record&lt;string, [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md)<!-- -->&gt; | Specify the externals to be loaded. The externals should be Lynx Bundles. |
| [mainThreadLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.mainthreadlayer.md) | | string | The name of the main thread layer. |
<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[backgroundLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.backgroundlayer.md)


</td><td>


</td><td>

string


</td><td>

The name of the background layer.


</td></tr>
<tr><td>

[externals](./externals-loading-webpack-plugin.externalsloadingpluginoptions.externals.md)


</td><td>


</td><td>

Record&lt;string, [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md)<!-- -->&gt;


</td><td>

Specify the externals to be loaded. The externals should be Lynx Bundles.


</td></tr>
<tr><td>

[globalObject?](./externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md)


</td><td>


</td><td>

'lynx' \| 'globalThis' \| undefined


</td><td>

_(Optional)_ This option indicates what global object will be used to mount the library.

In Lynx, the library will be mounted to `lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")]` by default.

If you have enabled share js context and want to reuse the library by mounting to the global object, you can set this option to `'globalThis'`<!-- -->.

'lynx'


</td></tr>
<tr><td>

[mainThreadLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.mainthreadlayer.md)


</td><td>


</td><td>

string


</td><td>

The name of the main thread layer.


</td></tr>
<tr><td>

[timeout?](./externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md)


</td><td>


</td><td>

number \| undefined


</td><td>

_(Optional)_ The timeout in milliseconds for loading the externals.


</td></tr>
</tbody></table>

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) &gt; [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) &gt; [timeout](./externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md)

## ExternalsLoadingPluginOptions.timeout property

The timeout in milliseconds for loading the externals.

**Signature:**

```typescript
timeout?: number | undefined;
```

## Default Value

2000

Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ Whether the source should be loaded asynchronously or not.
```typescript
async?: boolean;
```

## Default Value

`true`

Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ The options of the background layer.
```typescript
background?: LayerOptions;
```

## Default Value

`undefined`

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) &gt; [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md) &gt; [bundlePath](./externals-loading-webpack-plugin.externalvalue.bundlepath.md)

## ExternalValue.bundlePath property

The bundle path resolved against the runtime public path.

Prefer this over `url` when the bundle should follow the active `publicPath`<!-- -->. The runtime will load it with `publicPath + bundlePath`<!-- -->, which keeps external bundle resolution aligned with the current build output without hard-coding an absolute URL into the generated runtime code.

**Signature:**

```typescript
bundlePath?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ externals: {
libraryName?: string | string[];
```

## Default Value

`undefined`

## Example

`Lodash`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ The options of the main-thread layer.
```typescript
mainThread?: LayerOptions;
```

## Default Value

`undefined`

Loading
Loading