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

mk-scripts

v4.0.3

Published

Fork from react-scripts.

Downloads

17

Readme

Custom Changes

  • Add tailwindcss so it is supported by default
  • Add focus-visible package with postcss-focus-visible so we can use :focus-visible pseudoselector.
  • Add ability to override the files based on parameter you pass in the command, which will be described below.

Overriding File to be Used

Assuming you want to use custom index.html file or .env file for different environments. Default react-scripts does not support this use case as it always use public/index.html for HTML and it always use .env or .env.production during build.

  1. Create a file called react.config.js at the root of your project with the following contents:

    module.exports = {
      overrides: {
        preprod: {
          // assuming you have a `index.preprod.html` file in `public` folder that should be used when your build target is `preprod`.
          appHtml: path.resolve(__dirname, 'public', 'index.preprod.html'),
          // assuming you have a `.env.preprod` file in an `env` folder that should be used when your build target is `preprod`.
          dotenv: path.resolve(__dirname, 'env', '.env.preprod'),
        },
        testing: {
          appHtml: path.resolve(__dirname, 'public', 'index.testing.html'),
        },
      },
    };

    The file must export an object like the example above. overrides property is an object whose properties are the type of configuration you want to support (usually it will be your environment, like staging, preprod, prod etc.).

  2. Each object can define two properties: appHtml, and dotenv, which must be the absolute path that you want to override.

  3. Then, when you run the command, you can pass --config <env> to override them, e.g.

    npx react-scripts build --config preprod

    or just define the commands in your package.json:

    {
      "scripts": {
        "build:preprod": "react-scripts build --config preprod",
        "build:testing": "react-scripts build --config testing"
      }
    }