Skip to content

magic-gear/dev-resolve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dev-resolve

A webpack plugin for resolving dependency in development

Features

The goal of the webpack plugin is to make you develop and test your self-developed dependencies easily, in your own apps

  • reoslves your self-developed dependencies from repo location instead of node_modules of the app project
  • use babel option in each repo to transpile your self-developed dependencies, as if you are using published packages
  • each self-dependency is a independent package, lockfile won't be affected, which happens in a workspace, you can open source it alone to others
  • package manager agnostic: we implement a link mechanism to register your package to avoid flaws of package manager link, so you can use any package manager with dev-resolve
  • resolve common dependencies: some dependencies, as such react, you should make sure you use the same copy as in your app across all dependencies

Install

npm add -D @magic-gear/dev-resolve

Usage

Step 1: Link your packages

cd /path/to/your/package
npx @magic-gear/dev-resolve link

This create a link in a global node_modules like directory, make the plugin in app can find the dependencies.

Step 2: Config the plugin in your app

// webpack.config.js
const DevResolvePlugin = require('@magic-gear/dev-resolve')

module.exports = {
  plugins: [new DevResolvePlugin(), ...other plugins],
  ...other configs
}

This plugin hooks into webpack by watchRun hook, so it only works with dev-server.

About

A webpack plugin for resolving dependency in development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published