GithubHelp home page GithubHelp logo

nh-199 / webpack-federated-stats-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacob-ebey/webpack-federated-stats-plugin

0.0 0.0 0.0 65 KB

Write out relevant federation stats to a file for further consumption.

JavaScript 56.43% TypeScript 43.57%

webpack-federated-stats-plugin's Introduction

webpack-federated-stats-plugin

This plugin will ingest the webpack stats object, process / transform the object and write out relevant federation stats to a file for further consumption.

The most common use case is building a hashed bundle and wanting to programmatically refer to the correct bundle path in your Node.js server.

Install

> npm i --save-dev webpack-federated-stats-plugin

Usage

const FederatedStatsPlugin = require("webpack-federated-stats-plugin");

module.exports = {
  plugins: [
    new FederatedStatsPlugin({
      filename: "federation-stats.json",
    }),
  ],
};

Example Output

{
  "sharedModules": [
    {
      "chunks": [
        "http://localhost:5000/client-bundle/node_modules_preact_hooks_dist_hooks_module_js-_41171.js"
      ],
      "provides": [
        {
          "shareScope": "default",
          "shareKey": "preact/hooks",
          "requiredVersion": "^10.5.7",
          "strictVersion": true,
          "singleton": false,
          "eager": false
        }
      ]
    },
    {
      "chunks": [
        "http://localhost:5000/client-bundle/vendors-node_modules_preact_dist_preact_module_js.js"
      ],
      "provides": [
        {
          "shareScope": "default",
          "shareKey": "preact",
          "requiredVersion": "^10.5.7",
          "strictVersion": true,
          "singleton": false,
          "eager": false
        }
      ]
    },
    {
      "chunks": [
        "http://localhost:5000/client-bundle/vendors-node_modules_universal-router_sync_module_js.js"
      ],
      "provides": [
        {
          "shareScope": "default",
          "shareKey": "universal-router/sync",
          "requiredVersion": "^9.0.1",
          "strictVersion": true,
          "singleton": false,
          "eager": false
        }
      ]
    }
  ],
  "federatedModules": [
    {
      "remote": "preactFrameworkExample",
      "entry": "http://localhost:5000/client-bundle/routes.js",
      "remoteModules": {
        "otherRemote/exposedFile": 893
      },
      "sharedModules": [
        {
          "chunks": [
            "http://localhost:5000/client-bundle/node_modules_preact_hooks_dist_hooks_module_js-_41171.js"
          ],
          "provides": [
            {
              "shareScope": "default",
              "shareKey": "preact/hooks",
              "requiredVersion": "^10.5.7",
              "strictVersion": true,
              "singleton": false,
              "eager": false
            }
          ]
        },
        {
          "chunks": [
            "http://localhost:5000/client-bundle/vendors-node_modules_preact_dist_preact_module_js.js"
          ],
          "provides": [
            {
              "shareScope": "default",
              "shareKey": "preact",
              "requiredVersion": "^10.5.7",
              "strictVersion": true,
              "singleton": false,
              "eager": false
            }
          ]
        },
        {
          "chunks": [
            "http://localhost:5000/client-bundle/vendors-node_modules_universal-router_sync_module_js.js"
          ],
          "provides": [
            {
              "shareScope": "default",
              "shareKey": "universal-router/sync",
              "requiredVersion": "^9.0.1",
              "strictVersion": true,
              "singleton": false,
              "eager": false
            }
          ]
        }
      ],
      "exposes": {
        "./src/routes/About.tsx": [
          {
            "chunks": [
              "http://localhost:5000/client-bundle/src_routes_About_tsx.css",
              "http://localhost:5000/client-bundle/src_routes_About_tsx.js"
            ],
            "sharedModules": [
              {
                "chunks": [
                  "http://localhost:5000/client-bundle/vendors-node_modules_preact_dist_preact_module_js.js"
                ],
                "provides": [
                  {
                    "shareScope": "default",
                    "shareKey": "preact",
                    "requiredVersion": "^10.5.7",
                    "strictVersion": true,
                    "singleton": false,
                    "eager": false
                  }
                ]
              }
            ]
          }
        ],
        "./src/routes/Home.tsx": [
          {
            "chunks": [
              "http://localhost:5000/client-bundle/src_routes_Home_tsx.css",
              "http://localhost:5000/client-bundle/src_routes_Home_tsx.js"
            ],
            "sharedModules": [
              {
                "chunks": [
                  "http://localhost:5000/client-bundle/vendors-node_modules_preact_dist_preact_module_js.js"
                ],
                "provides": [
                  {
                    "shareScope": "default",
                    "shareKey": "preact",
                    "requiredVersion": "^10.5.7",
                    "strictVersion": true,
                    "singleton": false,
                    "eager": false
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ]
}

webpack-federated-stats-plugin's People

Contributors

jacob-ebey avatar scriptedalchemy avatar noreiller avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.