Build Plugin Stark Module

2.3.0 · active · verified Sun Apr 19

build-plugin-stark-module is a build-scripts plugin specifically designed for integrating applications as 'stark modules' within the icestark micro-frontend framework, developed by Alibaba. As of version 2.3.0, this plugin facilitates the build process by allowing developers to configure multiple entry points, optimize module loading performance through external dependencies (similar to Webpack externals), and customize output filenames and minification settings. It primarily functions by extending the build configuration of `@ice/app` or `build-scripts`, where it's specified in the `build.json` file rather than being imported directly into application code. Its stable release cadence is not explicitly stated but appears to follow the larger Ice.js ecosystem's development. Key differentiators include its tight integration with icestark for micro-frontend architectures and its focus on build-time optimizations for such modules.

Warnings

Install

Quickstart

Demonstrates how to configure build-plugin-stark-module in a build.json file, setting up multi-module entries and external dependencies.

{
  "plugins": [
    ["build-plugin-stark-module", {
      "outputDir": "./build",
      "modules": {
        "branch-detail": "./src/branch-detail/index.tsx",
        "edit-info": "./src/edit-info/index.tsx"
      },
      "moduleExternals": {
        "react": {
          "root": "React",
          "url": "https://g.alicdn.com/code/lib/react/16.14.0/umd/react.production.min.js"
        },
        "react-dom": {
          "root": "ReactDOM",
          "url": "https://g.alicdn.com/code/lib/react-dom/16.14.0/umd/react-dom.production.min.js"
        }
      },
      "filenameStrategy": "./[name]/index",
      "minify": true,
      "sourceMap": false
    }]
  ]
}

view raw JSON →