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

default-no-import-side-effects-webpack-plugin

v1.0.0

Published

Webpack assumes all modules have import side effects unless otherwise specified via the `sideEffects` field in the corresponding `package.json`.

Downloads

14

Readme

default-no-import-side-effects-webpack-plugin

Webpack assumes all modules have import side effects unless otherwise specified via the sideEffects field in the corresponding package.json.

This plugin alters the default behavior so that if the corresponding package.json omits the sideEffects field, its files are assumed to be free of import side effects.

const DefaultNoImportSideEffectsPlugin = require("default-no-import-side-effects-webpack-plugin");

new DefaultNoImportSideEffectsPlugin({
  // Specify any packages that should not be side effect free by default.
  ignoredPackages: ["some-effectful-pkg"] // default: []

  // This plugin only applies to modules imported via import statements
  // located in source code within the root compilation context directory.
  // To force defaulting even in import statements in files outside of the root
  // compilation context directory, set this property to true.
  includeNonRootContextIssuers: true // default: false

  // This plugin only applies to imported files that are located outside the
  // root compilation context directory.
  // To force defaulting even for files that located within the root
  // compilation context directory, set this property to true.
  includeRootContextResources: true // default: false
})

Caveats

If a given module is imported from both outside and inside the root context directory and it is labeled as side effect free by this plugin, both import statements will be treated as being free from side effects even if includeNonRootContextIssuers: false. While not necessarily desirable, this is emergent behavior from webpack implementation details and how it treats multiple imports to the same module.