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

react-app-rewired-single-spa

v0.1.0

Published

Use single-spa in your create-react-app

Downloads

919

Readme

react-app-rewired-single-spa

Use single-spa systemjs in your create-react-app.

npm NPM downloads

Quickly adapt react-scripts as a submodule of single-spa !!!
Support [email protected] [email protected] version.

Features

  • Support [email protected] compatible with common configuration migrations
  • Output systemjs library auto add SystemJSPublicPathPlugin
  • Support ReactFastRefresh hot refresh

Installation

npm i react-app-rewired-single-spa -D

Usage

This project is based on react-app-rewired.

/* config-overrides.js */
const {
  rewiredSingleSpa,
  rewiredSingleSpaDevServer,
} = require("react-app-rewired-single-spa");

module.exports = {
  webpack: rewiredSingleSpa(),
  devServer: function (configFunction) {
    return function (proxy, allowedHost) {
      const config = configFunction(proxy, allowedHost);
      return rewiredSingleSpaDevServer()(config);
    };
  },
};

// use `customize-cra`
const { override, overrideDevServer } = require("customize-cra");

module.exports = {
  webpack: override(
    rewiredSingleSpa({
      orgName: "you",
      projectName: "test",
      reactPackagesAsExternal: true,
      peerDepsAsExternal: true,
      orgPackagesAsExternal: true,
    })
  ),
  devServer: overrideDevServer(rewiredSingleSpaDevServer()),
};

Options

orgName

Type: string
The name of the organization this application is written for.

projectName

Type: string
The name of the current project. This usually matches the git repo's name.

entry

Type: string
Default: src/{orgName}-{projectName}.{js|jsx|ts|tsx} src/index.{js|jsx|ts|tsx}
The entry file.

outputFilename

Type: string
Default:

  • development {orgName}-{projectName}.[contenthash:8].js
  • production {orgName}-{projectName}.js

rootDirectoryLevel

Type: number
This is the rootDirectoryLevel that is passed to https://github.com/joeldenning/systemjs-webpack-interop.

reactPackagesAsExternal

Type: boolean
This will react react-dom as webpack externals or not.

orgPackagesAsExternal

Type: boolean
This changes whether package names that start with @your-org-name are treated as webpack externals or not.

peerDepsAsExternal

Type: boolean
This will package.json peerDependencies as webpack externals or not.

FQA

FastRefresh invalid

  • If react react-dom is external, react-dev-tool must be installed to refresh automatically. For details, please see https://github.com/facebook/react/issues/17552
  • Check whether the ws connection is normal, you can set in .env file
    • WDS_SOCKET_PORT "2002"
    • WDS_SOCKET_HOST "localhost"
    • WDS_SOCKET_PATH "/projectName" Please start with "/"

      The default hotreload client uses the relative website protocol, which is the protocol of the main base. It can use the localhost protocol and the local development port.

webpack < 5 used to include polyfills for node.js core modules by default

The following packages have been integrated by default, and the specified dependencies can be installed directly in the project.

{
  "url": "url",
  "fs": "fs",
  "assert": "assert",
  "crypto": "crypto-browserify",
  "http": "stream-http",
  "https": "https-browserify",
  "os": "os-browserify/browser",
  "buffer": "buffer",
  "stream": "stream-browserify"
}

You attempted to import XXXXXXXX which falls outside of the project src/ directory

You can use customize-cra removeModuleScopePlugin()

[email protected] postcss plugin error

You can use customize-cra

adjustStyleLoaders(({ use: [, , postcss] }) => {
  const postcssOptions = postcss.options;
  postcss.options = { postcssOptions };
});

License

MIT © fupengl