Nincompoops Producing Methane

    @cloudhms/craco-plugin-single-spa-application

    1.0.10 • Public • Published

    craco-plugin-single-spa-application

    Convert your CRA4 project into a single-spa application without ejecting and losing update support of react-scripts

    Install

    npm install craco-plugin-single-spa-application --save-dev
    

    Usage

    1. Add the plugin into your craco.config.js;
    singleSpaApplicationPlugin = require('craco-plugin-single-spa-application');
    
    module.exports = {
        plugins: [{
            plugin: singleSpaApplicationPlugin,
            options: {
            orgName: "my-org",
            projectName: "my-app",
            entry: "src/single-spa-index.tsx", //defaults to src/index.js,
            orgPackagesAsExternal: false, // defaults to false. marks packages that has @my-org prefix as external so they are not included in the bundle
            reactPackagesAsExternal: true, // defaults to true. marks react and react-dom as external so they are not included in the bundle
            externals: ["react-router","react-router-dom"], // defaults to []. marks the specified modules as external so they are not included in the bundle
            minimize: false, // defaults to false, sets optimization.minimize value
            useHash: false, // use webpack hash to bundle filename
            versionName: "1.0.1", use package version to bundle filename
          },
        }]
    }
    
    1. Update the scripts section of your package.json as follows:
      ...
      "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "craco:build": "craco build",
        "craco:start": "craco start",
        ...
    
    1. Run npm run craco:build to generate your microfrontend app bundle. The output will be located under build folder and named as my-org-my-app.js

    License

    Licensed under the MIT License, Copyright ©️ 2021 Hasan Ayan. See LICENSE.md for more information.

    Install

    npm i @cloudhms/craco-plugin-single-spa-application

    DownloadsWeekly Downloads

    4

    Version

    1.0.10

    License

    MIT

    Unpacked Size

    10.9 kB

    Total Files

    5

    Last publish

    Collaborators

    • vluanna