Skip to content

Instantly share code, notes, and snippets.

@georgiee
Created October 2, 2015 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save georgiee/6b24cdd89dc91c19f037 to your computer and use it in GitHub Desktop.
Save georgiee/6b24cdd89dc91c19f037 to your computer and use it in GitHub Desktop.
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