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

@dr-kobros/broilerplate

v0.29.2

Published

React Reusable Broilerplate

Downloads

22

Readme

Broilerplate

What is it?

A reusable Webpack / React configuration toolbox / broilerplate.

Why is it?

I don't believe in create-react-app. You always end up ejecting, and I think that it is too naive. That is why I believe create-react-app-rewired, which is a great tool, is doomed to fail.

My own previous reusable broilerplates have all failed. Some believe that all broilerplate projects are doomed to fail.

Still, mostly everything Webpack and broilerplate stuff are copy-paste. Making a webpack config is not hard per se, what is hard is to know and understand all the caveats. This knowledge also grows by doing, thus causing somewhat hidden technical debt in older projects.

Broilerplate offers a thin abstraction over Webpack. It has features that enable loaders and plugins, and a two by two matrix of feature sets: development / production + client / server.

From these combinations Broilerplate "just knows" how to configure your application.

  • Production grade settings from the get go.
  • Re-configure / remove / add anything
  • Never eject

And so forth. Will write good instructions when thoughts are validated.

How?

Initialize a project

  • yarn init

Add Broilerplate and all it's peer dependencies

Add broilerplate and all it's peer dependencies, somehow. This script will do.

(
  export PKG=@dr-kobros/broilerplate;
  npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs yarn add --dev "$PKG@latest"
)

Initialize Broilerplate

This will create the two base files for Broilerplate, .broilerplate.js and webpack.config.babel.js

  • yarn run broilerplate

Tune your configuration

Broilerplate's default configuration is a sane one, but you may edit .broilerplate.js to add and / or remove some features.

Add package scripts

Edit your package.json to contain the following scripts:

"scripts": {
  "start": "cross-env NODE_ENV=development webpack-dev-server --port 9000 --history-api-fallback --hot --inline --disable-host-check --progress",
  "build:client": "cross-env NODE_ENV=production webpack --progress --display-optimization-bailout",
  "build:server": "cross-env NODE_ENV=production webpack --progress --config webpack.server.config.babel.js --display-optimization-bailout",
  "build:node": "cross-env NODE_ENV=production babel src/index.js > dist-server/index.js",
  "build": "yarn run build:client && yarn run build:server && yarn run build:node"
}

Run start script for the first time

This will ensure that all the files from your selected feature set exist.

  • yarn run start

Develop

Have fun!