webpack-alias-config-plugin
Webpack plugin that provides a convenience to override modules require
paths, with an external set of matching files.
Usage
// webpack.config.jsconst webpackConfig =plugins:config: 'webpack.config.js'findConfig: true
Installation
Install via npm:
npm install --save-dev webpack-alias-config-plugin
Api
config findConfig extensions
-
config
(string): Path to your webpack config file.The plugin is going to look for a
webpack.config.js
file or awebpack.config.babel.js
at the root, in case your webpack configuration file is in another location, you can use this option to provide an absolute or relative path to it. You can also use environment variable in this option, using lodash template, for example:const webpackConfig =plugins:config: "${PWD}/webpack.config.test.js"And run with:
$ PWD=$(pwd) NODE_ENV=test ava -
findConfig
(boolean): Will find the nearest webpack configuration file when set totrue
.It is possible to pass a findConfig option, and the plugin will attempt to find the nearest webpack configuration file within the project using find-up. For example:
const webpackConfig =plugins:config: "webpack.config.test.js"findConfig: true
extensions
(optional)array
of extensions to resolve against (default: ['jsx', 'js'])