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

cookiecutter-webpack

v0.3.2

Published

Boilerplate for setting up webpack 2 configuration with hot reloading, babel for es6 modules, react + redux.

Downloads

6

Readme

Cookiecutter-webpack

Boilerplate for setting up webpack 2 configuration with hot reloading, babel for es6 modules, react + redux for views and state, and karma + mocha + expect for testing.

Getting Started

Download cookiecutter to a global python path

$ pip install cookiecutter

In your project directory run

$ cookiecutter [email protected]:hzdg/cookiecutter-webpack.git

Answer the prompts then cd into your newly created project directory.

Install npm packages

$ npm install

Start the server

$ npm start

Open up http://localhost:8080 in your browser.

You will have a React / Redux counter app running with redux dev-tools. See the generated README.md for an explanation of the react / redux project structure.

You can run the test suite

$ npm test

You should also create a new git repo and push it to github

$ git init
$ git add .
$ git commit -m "Init"
$ git remote add origin [email protected]:hzdg/project_name.git
$ git push -u origin master

Options

  • project_name: Your Project Name
  • repo_name: Name of this projects git repository
  • repo_owner: Your github username
  • static_root: Path to where this projects source code lives, or path to static files directory if integrating into an existing project
  • production_output_path: Path where your compiled bundles should go
  • author_name: Your Name
  • description: A short description of the project for the README.md file
  • version: Project version number
  • existing_project: n if this is a new project and y if you're integrating into an existing project. See the notes below about integrating into an existing project.
  • css_extension: [none, less, sass] - use less or sass to preprocess styles.
  • use_ejs: y if you want to include ejs templates and loaders in the project. Recommended if not using an existing project.

Integrating into existing projects

You can chain this into an existing cookiecutter project by installing via the projects ./hooks/post_gen_project.py file or just installing it via the command line.

Using post hooks

Here is a django project post hook example that chains this through a django cookiecutter project.

from cookiecutter.main import cookiecutter

  cookiecutter(
      '[email protected]:hzdg/cookiecutter-webpack.git',
      replay=False, overwrite_if_exists=True, output_dir='../',
      checkout=None, no_input=True, extra_context={
          'project_name': '{{ cookiecutter.project_name }}',
          'repo_name': '{{ cookiecutter.repo_name }}',
          'repo_owner': 'hzdg',
          'static_root': '{{ cookiecutter.project_dir }}/static/{{ cookiecutter.project_dir }}',
          'production_output_path': '{{ cookiecutter.project_dir }}/static/{{ cookiecutter.project_dir }}/dist/',
          'author_name': '{{ cookiecutter.author_name }}',
          'description': '{{ cookiecutter.description }}',
          'version': '{{ cookiecutter.version }}',
          'existing_project': 'y',
          'css_extension': 'sass',
          'use_ejs': 'n'
      })

The flag existing_project will move/remove some files and dependencies and also add supporting configurations for a django project.

Using command line

Just make sure you use the --overwrite-if-exists [ or -f] flag so cookiecutter can work within your existing project structure. You will also probably want to point to your existing projects parent directory and make sure you use the same repo_name as the project directory so your package.json files are installed at the project root.

cookiecutter -f -output-dir ../ [email protected]:hzdg/cookiecutter-webpack.git

Contributing

Accepting pull requests!

Clone the project:

$ git clone [email protected]:hzdg/cookiecutter-webpack.git

Install python and npm dependencies:

$ pip install -r requirements.txt && npm install

Run build tests:

$ npm test