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-webpack-template-cisen

v1.7.2

Published

A base skeleton template for react and webpack without task runners

Downloads

3

Readme

Welcome to react-webpack-template

This repository holds the base template for the current version of generator-react-webpack. It can also be used as the prototype for newly generated projects.

Build Status Amount of Downloads per month Dependency Tracker Dependency Tracker

Features

The following features are currently included:

  • [x] Webpack and Webpack-Dev-Server, including hot-loader
  • [x] Babel and JSX
  • [x] Mocha Unit tests
  • [x] esLint Support
  • [x] No dependency on grunt, gulp or the next hot taskrunner!
  • [x] Support for environment-specific configuration files
  • [x] Support for code coverage via isparta-loader

What is it for?

This template can be used directly for the creation of new projects. When using it like this, make sure to not install it via npm but download it directly. The template is (nearly) useless for itself when downloaded via npm!

Basically, it is currently only used as the base template of generator-react-webpack.

Using it

The template uses webpack as build tool to serve files and run tests. The following commands are available:

# Start for development
npm start # or
npm run serve

# Start the dev-server with the dist version
npm run serve:dist

# Just build the dist version and copy static files
npm run dist

# Run unit tests
npm test

# Run the unit tests continuously (repeat the test when code changes are saved)
npm run test:watch

# Lint all files in src (also automatically done AFTER tests are run)
npm run lint

# Clean up the dist directory
npm run clean

# Just copy the static assets
npm run copy

You can also use your globally installed version of webpack like this:

# Build or run the dev version:
webpack
webpack --env=dev

webpack-dev-server
webpack-dev-server --env=dev

# Build or run the dist version
webpack --env=dist
webpack-dev-server --env=dist

Including third party modules (e.g. from npm)

The default setting for the webpack configuration is to only include the src and test directories. If you want to add any modules from npm, you have to add them in cfg/base.js. One example is:

// Somewhere on top of the file:
let npmBase = path.join(__dirname, '../node_modules');
let additionalPaths = [ path.join(npmBase, 'react-bootstrap') ];

All entries added to the additionalPaths array will be appended to the include path for babel.

A note on unit testing

When running tests, coverage information (provided via Istanbul) will also be written into the coverage/ directory. If you do not need this, just comment out or remove the section in karma.conf like this:

/* do not use coverage reporting!
coverageReporter: {
  type: 'html',
  dir: 'coverage/'
}*/

Also, you should adjust your webpack test configuration (located in cfg/test.js) to reflect this:

/* Uncomment this to prevent loading via isparta
{
  test: /\.(js|jsx)$/,
  loader: 'babel-loader',
  include: [
    path.join(__dirname, '/../src')
  ],
  loader: 'isparta'
}*/

License

react-webpack-template is available under MIT-License and can therefore be used in any project free of charge.

Contributors