1.1.1 • Published 8 months ago

@ice/plugin-icestark v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

plugin-icestark

Easy use icestark in icejs.

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 function
  • appRouter
    • ErrorComponent: error component
    • LoadingComponent: loading component
    • NotFoundComponent: 404 not found component
    • shouldAssetsRemove: 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 mounted
  • unmount: excute after Sub-application unmounted
1.1.1

8 months ago

1.1.0

12 months ago

1.0.4-alpha.1

1 year ago

1.0.5-alpha.0

1 year ago

1.0.5-alpha.1

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.5-beta.1

1 year ago

1.0.5-beta.0

1 year ago

1.0.4-beta.0

1 year ago

1.0.3-beta.0

1 year ago

1.1.0-beta.0

1 year ago

1.0.2

1 year ago

1.0.2-beta.2

1 year ago

1.0.2-beta.3

1 year ago

1.0.2-beta.4

1 year ago

1.0.2-beta.1

1 year ago

1.0.1

1 year ago

1.0.1-beta.2

1 year ago

1.0.1-beta.1

1 year ago

1.0.0-beta.3

1 year ago

1.0.0-beta.2

1 year ago

1.0.0

1 year ago

1.0.0-beta.1

1 year ago