build-plugin-icestark

Easy use `icestark` in icejs.

Usage no npm install needed!

<script type="module">
  import buildPluginIcestark from 'https://cdn.skypack.dev/build-plugin-icestark';
</script>

README

plugin-icestark

Easy use icestark in icejs.

Usage

Framework Application

Through appConfig configuration of your framework application.

const appConfig = {
  ...
  icestark: {
    type: 'framework',
    getApps: () => {
      return [{
        path: '/seller',
        title: '商家平台',
        url: [
          '//ice.alicdn.com/icestark/child-seller-react/index.js',
          '//ice.alicdn.com/icestark/child-seller-react/index.css',
        ],
      }];
    },
  },
};

Options:

  • type: config framework to enable Framework application
  • getApps: get sub-application information, support async function
  • appRouter
    • ErrorComponent: error component
    • LoadingComponent: loading component
    • NotFoundComponent: 404 not found component
    • shouldAssetsRemove
  • removeRoutesLayout: remove global Layout when config true
  • AppRoute: custom AppRoute component
  • Layout: specify Framework application Layout, use layouts/index as default if exisit

Sub-application

modify appConfig:

// app.ts
const appConfig = {
  ...
  icestark: {
    type: 'child',
  },
};

Options:

  • type: config child to enable Sub-application