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

cra-build-watch-js

v1.0.4

Published

A script for create-react-app that writes development builds to the disk

Downloads

10

Readme

Forked from https://github.com/Nargonath/cra-build-watch in order to work with newer react-scripts

semantic-release code style: prettier Commitizen friendly Build Status npm version License: MIT

Disclaimer

The builds resulting from this script are NOT for production environment. They lack various optimizations.

This script is meant as a temporary workaround for create-react-app project based until this feature is built-in into react-scripts. See create-react-app#1070.

This script is inspired by other work related such as: https://gist.github.com/jasonblanchard/ae0d2e304a647cd847c0b4493c2353d4.

Why do I need this?

As of now (20/04/2018), create-react-app (more precisely react-scripts) does not allow development builds to be written to the disk because it uses webpackDevServer to serve your build files and folders (for good reasons). The problem is that in some cases you need to have these files written to the disk i.e:

  • Developing browser extensions using React.
  • Incorporating your React application into an existing application.
  • Serving your React app with a dedicated backend.

Installation

Add it to your project using npm:

npm install -D cra-build-watch-js

or using yarn:

yarn add -D cra-build-watch-js

Usage

Add a new script into your package.json:

{
  "scripts": {
    "watch": "cra-build-watch"
  }
}

Run that script:

npm run watch

with Yarn:

yarn watch

Configuration

By default the script will generate everything into build/ at your project root and remove the public path from webpack's configuration.

If those defaults do not work for you, the script accepts some arguments:

  • -b|--build-path: expects either an absolute or relative path. If a relative path is given it will be prefixed by your project root path.
    • default: yourProjectRoot/build.
  • -p|--public-path: expects a relative URL where / is the root. If you serve your files using an external webserver this argument is to match with your web server configuration. More information can be found in webpack configuration guide.
    • default: "".
  • -v|--verbose: display webpack build output.