Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scope:
How to create a local project which should be use in another local project- as a library
.
+ Make it a local linked package, install it in your other project, enable the library option in webpack, builed it manually or with the watch option.
1. Use npm link to symlink your local module A into module B. So all your changes in module A are reflected immediately in module B
See here: https://docs.npmjs.com/cli/link
2. Make sure that your source module (A) is wrapped correctly by webpack so you can require it like any other library.
Use this: https://github.com/webpack/webpack/tree/master/examples/multi-part-library
3. Now you can require it normally and now focus on Project B! :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.