{"_id":"@elzajs/auto-route-plugin","_rev":"1-7420b59756c9fd06ece6f75b40dd4dde","name":"@elzajs/auto-route-plugin","description":"自动生成路由文件插件","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.5":{"name":"@elzajs/auto-route-plugin","version":"0.1.5","keywords":["typescript","webpack","plugin","auto-route"],"author":{"name":"limy","email":"lmy865713897@gmail.com"},"license":"MIT","_id":"@elzajs/auto-route-plugin@0.1.5","homepage":"https://github.com/865713897/auto-route-plugin#readme","bugs":{"url":"https://github.com/865713897/auto-route-plugin/issues"},"dist":{"shasum":"f2c8b5ef80e1266ab5538460080c20ad7adeaae6","tarball":"https://registry.npmjs.org/@elzajs/auto-route-plugin/-/auto-route-plugin-0.1.5.tgz","fileCount":7,"integrity":"sha512-0Stb1kE8SC50e9i1ppBGcsQGjqrAELah9xiMtVW5vyj9glM09c5oeY6SFALYe8xtCVoGAgNR74xfK1EpJKAw2A==","signatures":[{"sig":"MEYCIQDahJ0LdmJ34Qut7jseudYwAssn0JDgMo3qMtWY4YtclgIhANFFKyfRE/ENNdfrbCFpXW8Ber2QuFjvPOzgr7y9+fRC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29518},"main":"lib/index.cjs","types":"lib/index.d.ts","exports":{"import":{"types":"./lib/index.d.mts","default":"./lib/index.mjs"},"require":{"types":"./lib/index.d.cts","default":"./lib/index.cjs"}},"gitHead":"93d0e0135abf54231f130ab02eda37036ec752a2","scripts":{"build":"unbuild"},"_npmUser":{"name":"user_limy","email":"865713897@qq.com"},"repository":{"url":"git+https://github.com/865713897/auto-route-plugin.git","type":"git"},"_npmVersion":"8.19.2","description":"自动生成路由文件插件","directories":{},"_nodeVersion":"18.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"unbuild":"^2.0.0","@types/node":"^20.12.12","@types/webpack":"^5.28.5"},"peerDependencies":{"webpack":">=5.91.0"},"_npmOperationalInternal":{"tmp":"tmp/auto-route-plugin_0.1.5_1719212048511_0.3384554085301097","host":"s3://npm-registry-packages"}},"0.1.6":{"name":"@elzajs/auto-route-plugin","version":"0.1.6","description":"自动生成路由文件插件","main":"lib/index.cjs","types":"lib/index.d.ts","exports":{"import":{"types":"./lib/index.d.mts","default":"./lib/index.mjs"},"require":{"types":"./lib/index.d.cts","default":"./lib/index.cjs"}},"scripts":{"build":"unbuild"},"publishConfig":{"access":"public"},"peerDependencies":{"webpack":">=5.91.0"},"devDependencies":{"@types/node":"^20.12.12","@types/webpack":"^5.28.5","unbuild":"^2.0.0"},"keywords":["typescript","webpack","plugin","auto-route"],"repository":{"type":"git","url":"git+https://github.com/865713897/auto-route-plugin.git"},"author":{"name":"limy","email":"lmy865713897@gmail.com"},"license":"MIT","gitHead":"b139972c0a00b4e608b1bb9210baffd70975f2c3","bugs":{"url":"https://github.com/865713897/auto-route-plugin/issues"},"homepage":"https://github.com/865713897/auto-route-plugin#readme","_id":"@elzajs/auto-route-plugin@0.1.6","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-0hzvc/ScMSVanHVrgC8OwWCfBoLvpvc5kK8a+dW7HBHibet8YiES4iSVd/N/K2k19tB4Qu8Gez4ZCTCkPH/Cmg==","shasum":"61e5db4b79d456aa7f670afbc66fc93abf35f489","tarball":"https://registry.npmjs.org/@elzajs/auto-route-plugin/-/auto-route-plugin-0.1.6.tgz","fileCount":7,"unpackedSize":29685,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDUmRWqlNyQDkEEB3Z+DOIO6AFtaiyWKPDCntU3FJ/EAiBIn6SorjrGm3BR4HHGJRl7FQWF/93eGLW0yYO0BwLsEA=="}]},"_npmUser":{"name":"user_limy","email":"865713897@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/auto-route-plugin_0.1.6_1719798072663_0.053013371680250776"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-24T06:54:08.407Z","modified":"2024-07-01T01:41:12.995Z","0.1.5":"2024-06-24T06:54:08.637Z","0.1.6":"2024-07-01T01:41:12.822Z"},"maintainers":[{"name":"user_limy","email":"865713897@qq.com"}],"author":{"name":"limy","email":"lmy865713897@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/865713897/auto-route-plugin.git"},"keywords":["typescript","webpack","plugin","auto-route"],"license":"MIT","homepage":"https://github.com/865713897/auto-route-plugin#readme","bugs":{"url":"https://github.com/865713897/auto-route-plugin/issues"},"readme":"# auto-route-plugin\n\n> 自动生成路由表的 webpack 插件\n\n## 介绍\n\n该插件自动查找src/pages文件夹下面的所有目录，根据文件路径生成对应的路由结构。\n\n## 安装\n\n```bash\npnpm add @elza/auto-route-plugin -D\n# or\nyarn add @elza/auto-route-plugin -D\n# or\nnpm install @elza/auto-route-plugin -D\n```\n\n## 参数\n\n```javascript\ninterface IAutoRoutePlugin {\n  /**\n   * 排除的文件夹\n   * @default []\n   */\n  excludeFolders?: string[];\n  /**\n   * 路由模式\n   * @default 'hash'\n   */\n  routingMode?: 'browser' | 'hash';\n  /**\n   * 是否只生成路由表\n   * @default false\n   */\n  onlyRoutes?: boolean;\n  /**\n   * 路由默认路径\n   * @default '/index'\n   */\n  indexPath?: string;\n}\n```\n\n## 使用\n\n```javascript\n// webpack.config.ts\nimport AutoRoutePlugin from '@elza/auto-route-plugin';\n// webpack.config.js\nconst AutoRoutePlugin = require('@elza/auto-route-plugin');\n\nmodule.exports = {\n  // ...\n  plugins: [\n    new AutoRoutePlugin({\n      excludeFolders: ['components'],\n      routingMode: 'browser',\n      onlyRoutes: false,\n      indexPath: '/home',\n    }),\n  ],\n};\n```\n\n## 示例\n\n当你启动项目过后，插件会自动在pages文件夹下生成router文件夹以及相应的内容\n\n![示例](./assets/example.gif)\n","readmeFilename":"readme.md"}