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

create-minimal-webpack-app

v1.0.4

Published

A minimal site generator using [Webpack][] and friends.

Downloads

19

Readme

create-minimal-webpack-app

A minimal site generator using Webpack and friends.

Features

  • HTML:: The index.html file is generated and automatically includes Webpack CSS/JS bundles using the HTML Webpack Plugin. It also can optionally include configured data passed down from package.json.
  • CSS: The CSS Loader allows you to import CSS files in your JavaScript when needed. This CSS is compiled together and extracted to a main.css file by way of the Mini CSS Extract Plugin.
  • JavaScript: No need to worry about compatibility in browsers, your code will be transpiled from ES2015 into something they can understand. Webpack installs and configures Babel for you.
  • Assets: The URL Loader is installed for loading image/font assets as URLs, so you can use them in your JS/CSS with ease. Additionally, the public/ directory is populated with favicons and other files that are served statically.
  • Linting: ESLint and Stylelint are automatically configured with recommended JS/CSS settings, and some additional helper rules. This can be found in the package.json for later editing.
  • Development: Webpack Dev Server is installed so you can get to coding right away. It automatically reloads modules that change, so you can see changes without needing to refresh.
  • Deployment: The yarn deploy task builds your app and deploys the dist/ directory to Surge. It's meant as a starting point, but Surge is a great hosting provider so there's no shame in keeping the default! Just make sure you add a -d YOUR_DOMAIN to the end so you don't get a random *.surge.sh domain each time you deploy.

Usage

With Yarn:

yarn create minimal-webpack-app your-app-name

With NPM:

npm install create-minimal-webpack-app
create-minimal-webpack-app your-app-name

You'll get an application directory with the following contents:

your-app-name
├── index.html
├── package.json
├── public
│   ├── android-chrome-192x192.png
│   ├── android-chrome-512x512.png
│   ├── favicon-16x16.png
│   ├── favicon-32x32.png
│   ├── favicon.ico
│   └── site.webmanifest
├── src
│   ├── index.css
│   └── index.js
├── webpack.config.js
└── yarn.lock

2 directories, 12 files

This will get you going with the bare minimum necessary to start developing.

Start the server by running:

yarn start

To run lint checks:

yarn lint

You can also build the application to dist/:

yarn build

Or, deploy to Surge using a random domain:

yarn deploy

NOTE: This will change domain names each time unless you pass a -d your-original-domain.surge.sh the next time you deploy.

Configuration

To configure the title of the app, edit app.title from package.json:

{
  "app": {
    "title": "Your App Name"
  }
}

You can use this object to pass additional configuration to your HTML:

{
  "app": {
    "title": "Your App Name",
    "heading": "Hello World"
  }
}

Read it out using EJS tags:

<h1><%= htmlWebpackPlugin.options.heading %></h1>