{"id":27437291,"url":"https://github.com/ifwu/vue-separate-files-loader","last_synced_at":"2025-04-14T20:19:56.004Z","repository":{"id":65379051,"uuid":"102202821","full_name":"iFwu/vue-separate-files-loader","owner":"iFwu","description":"[Deprecated] Load separate .js, .html, .css files under same directory as one .vue file.","archived":false,"fork":false,"pushed_at":"2017-09-09T15:14:02.000Z","size":16,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T20:19:48.369Z","etag":null,"topics":["frontend","javascript","vue","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iFwu.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}},"created_at":"2017-09-02T14:40:37.000Z","updated_at":"2020-08-17T15:38:25.000Z","dependencies_parsed_at":"2023-01-20T08:25:13.985Z","dependency_job_id":null,"html_url":"https://github.com/iFwu/vue-separate-files-loader","commit_stats":null,"previous_names":["xekri/vue-separate-files-loader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iFwu%2Fvue-separate-files-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iFwu%2Fvue-separate-files-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iFwu%2Fvue-separate-files-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iFwu%2Fvue-separate-files-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iFwu","download_url":"https://codeload.github.com/iFwu/vue-separate-files-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248952355,"owners_count":21188427,"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":["frontend","javascript","vue","webpack"],"created_at":"2025-04-14T20:19:55.099Z","updated_at":"2025-04-14T20:19:55.917Z","avatar_url":"https://github.com/iFwu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-separate-files-loader\n[![npm version](https://badge.fury.io/js/vue-separate-files-loader.svg)](https://badge.fury.io/js/vue-separate-files-loader)\n\n\nLoad separate .js, .html, .css files under same directory as one .vue file.\nIt uses `src` attr in .vue file's tag, so support all features that vue-loader suports.\n\n\u003e Differences between [vue-builder-webpack-plugin](https://github.com/pksunkara/vue-builder-webpack-plugin): It won't output a .vue file under your project directory, instead, it will load all files and directly output to vue-loader, so you can keep your repo cleaner😃!\n\n## Install\n```\nnpm install vue-separate-files-loader --save-dev\n```\nor\n```\nyarn add --dev vue-separate-files-loader\n```\n## Usage\n\nSuppose you have files below:\n```\n├── foo\n│   ├── bar.css\n│   ├── foo.css\n│   ├── foo.html\n│   └── index.js\n└── index.js\n```\n\nYou can use `foo` directory as one .vue file to be imported by any other file.\n\n### Setup webpack config\nHere is a part of webpack config file to use this loader.\n```js\n...\nmodule: {\n  rules: [\n    {\n      test: /\\.jsx?$/,\n      /* recommended, avoid unnessary import */\n      include: /foo/,\n      use: [\n        /* note the order of loaders is from last to first */\n        {\n          loader: 'vue-loader'\n          options: {\n            /* normal vue-loader options */\n            postcss: [require('postcss-cssnext')()]\n          }\n        },\n        {\n          loader: 'vue-separate-files-loader',\n          options: {\n            scoped: true, // use vue-loader's scoped css\n          }\n        }\n      ]\n    }\n  ]\n}\n...\n```\n## Options\nActually, all options you pass to this loader, will be passed as attributes to `\u003cstyle\u003e\u003c/style\u003e`.\n### examples\n```js\n...\n{\n  loader: 'vue-separate-files-loader',\n  options: {\n    module: true, // use css modules =\u003e \u003cstyle module\u003e\u003c/style\u003e\n  }\n}\n...\n```\n```js\n...\n{\n  loader: 'vue-separate-files-loader',\n  options: {\n    module: 'a', // use css modules and its module name is \"a\" =\u003e \u003cstyle module=\"a\"\u003e\u003c/style\u003e\n  }\n}\n...\n```\n\n## TODOS\n* [ ] support custome blocks\n* [ ] use magic comments to indicate tag attr option\n* [ ] if module is enabled, use file name as module name\n\n## Contribution\nAll kind of issues or pull requests are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifwu%2Fvue-separate-files-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fifwu%2Fvue-separate-files-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifwu%2Fvue-separate-files-loader/lists"}