@ice/stark-loader
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

icestark-loader

icestark-loader is a JavaScript library for loading module. icestark docs.

NPM version Package Quality build status Test coverage NPM downloads David deps

Installation

npm install @ice/stark-loader --save

API

mount: function

mount(rootElement, entry, rootId: string = 'icestark-loader')

  • rootElement: string | function | HTMLElement
  • entry: string | string[]
    • string with '' is treated as htmlContent
    • string without '' is treated as htmlUrl
    • string[] is treated as urls for js/css asserts
  • rootId: string (defalut 'icestark-loader')

unmount: function

example

<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>ICE BLOCK</title>
  </head>
  <body>
    <div id="moduleWrapper">
  </body>
</html>
import { mount, unmount } from '@ice/stark-loader';

// trigger mount
mount('moduleWrapper', 'https://unpkg.com/@icedesign/ability-introduction-block@3.0.1/build/index.html');

// trigger unmount
unmount();

Contributors

Feel free to report any questions as an issue, we'd love to have your helping hand on icestark.

If you're interested in icestark, see CONTRIBUTING.md for more information to learn how to get started.

License

MIT

Package Sidebar

Install

npm i @ice/stark-loader

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

3.68 kB

Total Files

2

Last publish

Collaborators

  • linbudu
  • answershuto
  • chenjun1011
  • luhengchang228
  • sobear
  • clarkxia
  • rax-publisher