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

@invisionag/webpack-config-ivx

v4.4.2

Published

# Description This package provides a baseline configuration for webpack as it is being used within our organisation. It adds:

Downloads

66

Readme

@invisionag/webpack-config-ivx

Description

This package provides a baseline configuration for webpack as it is being used within our organisation. It adds:

Entries

  • Default entrypoint of ./src/index.js
  • babel-polyfills and fetch-polyfill

Loaders

  • JS loader with babel compilation
  • CSS loader
  • SVG loader
  • Image loader
  • Markdown loader
  • Font loader

We do not ship sass loaders since we're aiming to replace it with styled-components, and node-sass is a very heavy dependency, even for dev setups.

Plugins

  • HtmlWebpackPlugin takes an html template from ./src/index.html and injects scripts there

Optimization

  • Runtime-chunking
  • Chunk-splitting

Output

  • Outputs the template.html with injected scripts into the public folder, along with all chunks

DevServer

  • For development mode, start an IE compatible webserver with hot reloading on port 9002

Installation

  1. Install @invisionag/webpack-config-ivx as a development dependency. No need to add webpack or any loaders.
  2. (Optional) If you want to use a dev-server to run localle, install webpack-dev-server as a development dependency. Configuration will be handled by this package

Maintenance

  • run yarn upgrade-interactive --latest to update dependencies
  • make sure the node image used in the Dockerfile is the latest
  • run yarn test to verify everything is still running
  • publish a new version with yarn publish (see Publishing section)

Publishing

  • Make sure you are logged into NPM with npm whoami
  • Verify you are part of the invisionag organization on npm. If you aren't, ask any current member to invite you
  • Run yarn publish and enter a new version number (based on semVer)

Testing

A good way to test your changes is to publish a prerelease, then check out a repo using this config and update it to use the prerelease. Then, run this repos test suite and if everything still works, it's a good sign.

  1. Push your changes and create a PR to communicate that there is currently work going on, and to make the changes you want to introduce with the prerelease accessible to others.
  2. Publish your prerelease with yarn publish, then enter a version number ending with -my-branch-name.<someIncrementingNumber>, for example (if we are currently at 1.1.5 and you introduce minor, nonbreaking changes) 1.2.0-maintenance-july-0.
  3. check out (for example) csv-importer-ui
  4. change the version number of the dependency to this repository in the package.json to match your prerelease. You don't have to change the lockfile
  5. run yarn && yarn test.

If everything still works, you're looking good! You can now publish a regular version by running yarn publish again and simply leave the trailing prerelease stuff (1.2.0).

Usage

In your webpack.config.js, you can import this config as base config. Make sure you pass the current enviroment as an argument, so the base config can determine whether it is running in development or production mode:

const webpackConfigIvx = require('@invisionag/webpack-config-ivx');

module.exports = (env = 'development') => {
  const baseConfig = webpackConfigIvx(env);
  // ...
};

You can then extend the baseConfig as desired. A simple (complete) example to replace the devServer port would look like this:

module.exports = (env = 'development') => {
  const baseConfig = require('@invisionag/webpack-config-ivx')(env);
  return {
    ...baseConfig,
    devServer: {
      ...baseConfig.devServer,
      port: 9002,
    },
  };
};