mirror of https://github.com/alibaba/ice.git
CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Details
CI / build (16.x, windows-latest) (push) Has been cancelled
Details
CI / build (18.x, ubuntu-latest) (push) Has been cancelled
Details
CI / build (18.x, windows-latest) (push) Has been cancelled
Details
Coverage / coverage (16.x) (push) Has been cancelled
Details
Release / Release (16) (push) Has been cancelled
Details
|
||
---|---|---|
.. | ||
src | ||
CHANGELOG.md | ||
Context.d.ts | ||
README.md | ||
package.json | ||
runtime.d.ts | ||
tsconfig.json | ||
types.d.ts |
README.md
plugin-icestark
Usage
Install
npm i -D @ice/plugin-icestark
Framework Application
Configurate plugin to your ice.config.mts
:
import { defineConfig } from '@ice/app';
import icestark from '@ice/plugin-icestark';
export default defineConfig(() => ({
plugins: [
icestark({ type: 'framework' }),
],
}));
Through export icestark
configuration of your framework application.
import { defineFrameworkConfig } from '@ice/plugin-icestark/esm/types';
export const icestark = defineFrameworkConfig(() => ({
getApps: () => ([]),
}));
Options:
getApps
: get sub-application information, support async functionappRouter
ErrorComponent
: error componentLoadingComponent
: loading componentNotFoundComponent
: 404 not found componentshouldAssetsRemove
: check assets if it should be removed
layout
: specify Framework application Layout
Sub-application
Configurate plugin to your ice.config.mts
:
import { defineConfig } from '@ice/app';
import icestark from '@ice/plugin-icestark';
export default defineConfig(() => ({
plugins: [
icestark({ type: 'child' }),
],
}));
modify icestark
exports in src/app.ts
:
// app.ts
import { defineChildConfig } from '@ice/plugin-icestark/esm/types';
export const icestark = defineChildConfig(() => ({
mount: () => {},
unmount: () => {},
}));
Options:
mount
: excute before Sub-application mountedunmount
: excute after Sub-application unmounted