0.0.2 • Published 2 years ago
comp-invoking-webpack-plugin v0.0.2
comp-invoking-webpack-plugin
Install
# for webpack 4
npm install --save-dev comp-invoking-webpack-plugin
需要路由 json 文件,示例:
[
...
{
"routePath": "路由path",
"routeComp": "路由对应组件地址",
"name": "页面路由名称"
},
...
]
Usage
const CompInvokingWebpackPlugin = require('comp-invoking-webpack-plugin');
module.exports = {
...
plugins: [
new CompInvokingWebpackPlugin({
match: ['/components', '@dx/dx-ui'],
routePath: path.join(__dirname, '/src/router/routes.json'),
})
]
...
};
Options
Name | Type | Default | Description |
---|---|---|---|
match | {Array} | undefined | 需要匹配的组件 |
routePath | {String} | /\.(json)$/ | 项目路由 json 文件 |