upward-resolver-webpack-plugin

A webpack resolver plugin to upward resolve file.


Keywords
index, main, webpack
License
MIT
Install
npm install upward-resolver-webpack-plugin@0.1.1

Documentation

upward-resolver-plugin

Build Status Version License

A webpack resolver plugin to upward resolve file.

Install

npm i -D upward-resolver-plugin

webpack config

var UpwardResolverPlugin = require('upward-resolver-plugin')
var webpack = require('webpack')
{
  plugins: [
    new webpack.ResolverPlugin([
      new UpwardResolverPlugin({
        syntax: ['+'],
        dir: ['.']
      })
    ])
  ]
}

Example

/root
  /a
    /b
      /c
        index.js
    hello.js

In /root/a/b/c/index.js

require('+hello')

Then /root/a/hello.js will be resolved.