npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@muritavo/webpack-microfrontend-scripts

v0.1.16

Published

A series of webpack build and watch script with microfrontends in mind

Downloads

19

Readme

npm

Architecture decisions

This project comes bundled with the systemjs lib as it is the main library used to load microfrontends dinamically

What is this project

This project aims to create and build scripts that are focused on compiling microfrontend applications.

How to use it

  • Install this cli application inside your project using
# With npm
npm i @muritavo/webpack-microfrontend-scripts

# or with yarn
yarn add @muritavo/webpack-microfrontend-scripts
  • Inside the application you want to build:
    • Make sure the application has a src/index.ts (it is now hardcoded and a better detection system is on the roadmap)
    • Run the command yarn react-build or yarn react-start to build or watch the application respectively

How it is structured

The project has the following directory patterns

  • src: Where all the development sources are coded in
    • shared: Modules shared accross multiple framework setups
    • {framework}: Each script is focused on being used bound to a framework
      • scripts: The scripts to be provided by this application (mainly start & build)
      • test: An aplication to test each provided script (mainly start & build)
        • application: The source for the application that is being compiled for tests

Roadmap

Basic functionality

  • [x] Support TS
  • [x] Support JS
  • [x] Support JSX
  • [x] Support TSX
  • [x] Support CSS
  • [x] Support SCSS
  • [x] Support JSON
  • [x] Support SCSS Modules
  • [x] Support CSS Modules
  • [x] Support Hot swap
  • [x] Support SVGs, PNGs, and other files as simple sources
  • [x] Support Module federation
  • [x] Allow any index.EXT file to be used as entrypoint
  • [ ] Allow webpack manipulation from the base folder of the application
  • [ ] Setup precaching of the application with custom service worker
  • [ ] Allow multiple microfrontends being developed together

Optimizations

  • [x] Experiment with configuring module federation with uninstalled libraries (for example N mfes use a library that some don't use)
  • [ ] Separate the CSS from JS source (replace the style-loader by the mini-css-extract-plugin)
  • [ ] Support JSON treeshaking
  • [ ] Support SVG bundling / Reduce amount of small SVG files
  • [x] Scale images from png/jpg/inline svg to multiple versions for better resource usage

Standalone Features

Loaders

ImageResolutionOptimizer

This loader is used to create multiple versions of an image for multiple resolutions

There are three main loaders:

For non SVG resources

  • src/shared/loaders/ImageResolutionOptimizer/default.ts: Is used over png/jpg and other Sharp supported image formats.

For SVG resources (both loaders should be used together as of now)

  • src/shared/loaders/ImageResolutionOptimizer/extractImages.ts: Used over an SVG and extracts all inline image tag resources set at xlink:href to their specific files. It also defines 2 exports.

  • default: With the original SVG

  • Scaled: With the map of scaled svgs

  • src/shared/loaders/ImageResolutionOptimizer/namedSVG.ts: Modifies the inline ReactComponent from @svgr/webpack and injects the extracted images to be controled by a prop called props.scale (0.5x, 1x, 2x, 3x, 4x)

environment-usage-plugin

Babel plugin that checks for undefined env variables referenced on code and prevents compilation until those variables are defined