import-option-webpack-plugin
v1.0.2
Published
a webpack plugin to resolve dynamic path in compiling phase
Downloads
3
Readme
import-option-webpack-plugin
Install:
# npm
npm install import-option-webpack-plugin -D
# or Yarn
yarn add import-option-webpack-plugin -D
Usage:
webpack.config.js
const options = {
path1: 'demo1',
deep: {
path2: 'demo2'
},
path3: 'demo3',
}
module.exports = {
resolve: {
plugins: [
new ResolveFirstPlugin(options),
]
},
}
some-module.js
import {value as value1} from './{{path1}}';
import {value as value2} from './{{deep.path2}}';
import {value as value3} from './{{path3}}/{{path3}}';