{"id":14985717,"url":"https://github.com/foolishchow/vue-router-loader-yaml","last_synced_at":"2025-04-14T09:19:54.388Z","repository":{"id":126856633,"uuid":"88240733","full_name":"foolishchow/vue-router-loader-yaml","owner":"foolishchow","description":"load vue-router config via yaml","archived":false,"fork":false,"pushed_at":"2017-06-05T02:03:24.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T09:19:47.571Z","etag":null,"topics":["lazyload","loader","vue-router-loader","webpack","yaml"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foolishchow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-14T06:42:07.000Z","updated_at":"2021-06-12T03:05:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef0a4fb0-aa40-4f58-8276-0a30ba95fab3","html_url":"https://github.com/foolishchow/vue-router-loader-yaml","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":0.5,"last_synced_commit":"006d5bc7b906277bb0a5c3f46a2167e1c21bc9e2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolishchow%2Fvue-router-loader-yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolishchow%2Fvue-router-loader-yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolishchow%2Fvue-router-loader-yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolishchow%2Fvue-router-loader-yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foolishchow","download_url":"https://codeload.github.com/foolishchow/vue-router-loader-yaml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852186,"owners_count":21171843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lazyload","loader","vue-router-loader","webpack","yaml"],"created_at":"2024-09-24T14:11:32.093Z","updated_at":"2025-04-14T09:19:54.357Z","avatar_url":"https://github.com/foolishchow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-router-loader-yaml\nload vue-router config via yaml\n\u003e `0.0.3` meta can config in yaml \n\n\n\u003e useage   \n```shell\n npm install vue-router-loader-yaml --save-dev\n```\nin your webpack.config.js\n```js\nrules: [\n    {\n        test: /router\\.yaml$/,\n        loader: 'babel-loader!vue-router-loader-yaml'\n    },\n    // ...\n],\n//...\n\n```\n\n\u003e common useage   \n\n your yaml file:\n```yaml\nindex:\n    path: /\n    component: ./platform/system/index/index.vue\n    meta:\n        nav: none\n```\noutput:   \n\n```js\nimport index from './platform/system/index/index.vue';\n\nexport default [\n{\n    path: '/',\n    component: index.\n    meta:{nav:'none'}\n}];\n\n```\n\n\u003e lazyload    \n```yaml\nuserList:\n    path: /users\n    component: ./platform/system/users/user.vue\n    lazy:  system\n```\noutput:   \n\n```js\nconst userList = r=\u003erequire.ensure([],()=\u003er(require('./platform/system/users/user.vue')),'system');\n\nexport default [\n{\n    path: '/users',\n    component: userList\n}];\n\n```\n\n\u003e Nested router   \n\n```yaml\nindex:\n    path: /\n    component: ./platform/system/index/index.vue\n    children:\n        userList:\n            path: /users\n            component: ./platform/system/users/index.vue\n            lazy:  system\n        testList:\n            path: /test\n            component: ./platform/system/test/index.vue\n            lazy:  system\n```\noutput:   \n\n```js\nconst userList = r=\u003erequire.ensure([],()=\u003er(require('./platform/system/users/index.vue')),'system');\nconst testList = r=\u003erequire.ensure([],()=\u003er(require('./platform/system/test/index.vue')),'system');\nimport index from './platform/system/index/index.vue';\n\nexport default [\n{\n    path: '/',\n    component: index,\n    children:[\n{\n    path: '/users',\n    component: userList\n},\n{\n    path: '/test',\n    component: testList\n}]}];\n\n```\n\n\u003e lazyload extends and overwrited      \n```yaml\nindex:\n    path: /\n    component: ./platform/system/index/index.vue\n    lazy: base\n    children:\n        users:\n            path: /users\n            component: ./platform/system/users/index.vue\n            lazy:  False\n        testList:\n            path: /test\n            component: ./platform/system/test/index.vue\n            lazy:  system\n        mainList:\n            path: /main\n            component: ./platform/system/main/index.vue\n````\n- outout:\n```js\nimport users from './platform/system/users/index.vue';\nconst testList = r=\u003erequire.ensure([],()=\u003er(require('./platform/system/test/index.vue')),'system');\nconst mainList = r=\u003erequire.ensure([],()=\u003er(require('./platform/system/main/index.vue')),'base');\nconst index = r=\u003erequire.ensure([],()=\u003er(require('./platform/system/index/index.vue')),'base');\n\nexport default [\n{\n    path: '/',\n    component: index,\n    children:[\n{\n    path: '/users',\n    component: users\n},\n{\n    path: '/test',\n    component: testList\n},\n{\n    path: '/main',\n    component: mainList\n}]}];\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoolishchow%2Fvue-router-loader-yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoolishchow%2Fvue-router-loader-yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoolishchow%2Fvue-router-loader-yaml/lists"}