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

webpack-ignite

v1.1.0

Published

The fastest way to ignite your development with webpack

Downloads

18

Readme

Webpack Ignite

Table of Contents

  1. Environment Setup
  2. Configuration
  3. Start Developing
  4. Production Build Directions
  5. Future!

1. Environment Setup

Install Webpack Ignite globally (npm install -g webpack-ignite)

Create a new webpack projects

* run `wpignite ignite <project_folder>` 

Install NPM Packages

  • Run yarn install or npm install from the console in the folder that was just created.
  • Edit the package.json to have the correct information.

2. Configuration

Config files

Most of the configuration files are in the .ignite folder. The project defaults are generally pretty good but can be edited / overridden by editing overrides.js and editing the values contained in that file:

const basicConfigOverrides = {
    srcPath: 'src', //the location of the source files
    outputPath: 'build', //the output from npm run build
    contentPath: 'src', //Should almost always be the same as below. The path that content files are served from
    templatePath: 'src', //Should almost always match the above. The path that EJS templates are located in
    usejQuery: true, //Makes jQuery available to ES6 Modules for tree shaking
    usePreact: false, //Uses Preact rather than React for React compilation 
    useStandaloneVue: false, //Uses the Vue.JS standalone with the compiler
    useHashInProd: true, //Adds hashes to files in a production build for long term caching and cache busting
    minifyHTMLInProd: false, //Minifies the HTML output in a production build
    cleanBeforeBuild: true, // Removes all files from the output folder before a production build
    inlineAssetMaxSize: 20000, //File size threshold for saving assets inline in the CSS / HTML files
    hotOnlyDevServer: false, //hot only dev servers will not "auto reload" when a HMR update fails. Useful for React.
    devServerHost: "localhost", //The host the dev server should bind to.
    devServerAllowExternalAccess: false, //Allow non local browsers to connect to the dev server.
    autoOpenBrowser: true, //Open a browser once the dev server starts.
}

const advancedConfigOverrides = {
    publicPath: '/', //The public path the site will be hosted at.
    cssRelativePath: '../', //The relative path between the CSS files and the assets folder(s). 
    fileLoaderRelativePath: '../', //The relative path to the assets folder(s) for non CSS files.
    urlLoaderExclusions: [ //These items will not get processed by the URL loader and will always use the fileLoader
         /\.html$/,
         /\.(js|jsx|vue)(\?.*)?$/,
         /\.css$/,
         /\.scss$/,
         /\.json$/,
         /\.ejs$/,
    ],
    fileLoaderFiles: [], //Additional RegEx patterns for the fileLoader
    babelFiles: [/\.(js|jsx)$/], //Array Files that should be processes by Babel. Can be an array of RegEx patterns.
    babelExcludes: [], //Array Files that should NOT processed by Babel. Can be an array of RegEx patterns.
    devSourceMapMode: 'eval', //source map mode for dev server
    externals:{}, //Object for "externals" 
    cssPreProcessingExcludes: [], //Array Files that should NOT be processed by the CSS chain. Can be an array of RegEx patterns.
    postCssOptions: { //Options for postCSS / CSS chain
         data: '@import "global";', //import a global.scss file in every .scss file. This makes it easy to use foundation
         includePaths: [ //Paths to include in scss processing to make referencing .scss files easier.
             path.join(__appDir, '..', 'src/assets/scss/'), //this is where the global.scss file should live
             path.join(__appDir, '..', 'node_modules/foundation-sites/scss') //foundation
         ]
    }
}

3. Start Developing!!

Setup Entry Pages / Templates

  • Edit the .ignite/entries.js file to contain the pages you need to create. Follow the directions contained in that file.

Setup JS /EJS Files for each entry

  • Each entry in the entties.js file will need a .js file and a .ejs file configured per the .ignite/entries.js to work properly.

Start webpack

  • npm run start
  • Webpack dev server will pick a port (starting at 3000) and launch a browser (if configured to do so).

Build a website!

  • Use EJS, Sass, and ES6 and go to town!

4. Production Build Directions

For a production build run npm run build. The results of the build will be in the build folder and can be zipped and deployed to a server.

5. More stuff coming in the future

I have more plans for this in the future. You should be able to take advantage of any improvements to the build process by simply upgrading webpack-ignite in your project! (This will require that you don't edit the webpack.config to remove certain functionality)

  • Best practice tuning for webpack output
  • More concise settings
  • Better build / asset copy methods
  • Automated Testing
  • Multiple / Configurable Templates
  • React / Vue Examples