Skip to content

Instantly share code, notes, and snippets.

@fergiemcdowall
Last active December 5, 2023 14:02
Show Gist options
  • Save fergiemcdowall/aa275a01e18bffb308234f31221abe01 to your computer and use it in GitHub Desktop.
Save fergiemcdowall/aa275a01e18bffb308234f31221abe01 to your computer and use it in GitHub Desktop.
Testing tree-shaking with the stopword module

As per the issue on github

  1. Clone this repo
  2. run npm install
  3. run npm test. The output should ideally only contain English stopwords
import { eng } from "stopword";
console.log(eng);
{
"name": "test",
"browser": "index.js",
"type": "module",
"version": "1.0.0",
"description": "testing tree-shaking in stopword",
"main": "index.js",
"scripts": {
"test": "webpack && cat dist/main.js"
},
"dependencies": {
"stopword": "^2.0.8",
"webpack": "^5.89.0"
},
"devDependencies": {
"webpack-cli": "^5.1.4"
}
}
import webpack from "webpack";
export default [
{
mode: "production",
entry: "./index.js",
optimization: {
usedExports: true
},
},
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment