Skip to content

wix-incubator/externalize-relative-module-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

externalize-relative-module-loader

This loader aims to solve cases where a library makes an import from a specific file:

import map from 'lodash/map';

and app (that uses that lib) strives to put this dependency in its externals.

Install

npm install --save externalize-relative-module-loader

Usage

module.exports = {
  module: {
    rules: [
      {
        test: path.resolve('node_modules/lodash'),
        use: {
          loader: 'externalize-relative-module-loader'
        }
      }
    ]
  }
}

Assumptions

  • Bundle is a library (usage of output.libraryTarget).
  • Dep is included in externals.
  • Dep has the same exported property like the name of the imported file (for instance, map is the intended property in lodash/map).
  • Imported file is .js file - this one can be solved, PR is welcomed.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •