DEV Community

Clarice Bouwer
Clarice Bouwer

Posted on • Edited on

3 3

How to reference a local Webpack npm package

With the help of this question and answer:

Install the local npm package using the file path. Check node_modules to see the installed package.

npm install --save ../
Enter fullscreen mode Exit fullscreen mode

(or --save-dev depending on the requirements) && (in this example the package exists in the parent directory)

Note that you only specify the path to the package. No filename should be referenced.

The package will be referenced with the local file package. Note the file: protocol.

{
  "name": "venom",
  "scripts": {
    "build": "webpack"
  },
  "dependencies": {
    "hulk": "file:../"
  }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay