{"id":16919740,"url":"https://github.com/nicolo-ribaudo/vue-extract-loader","last_synced_at":"2025-04-11T16:39:25.474Z","repository":{"id":57395879,"uuid":"92101873","full_name":"nicolo-ribaudo/vue-extract-loader","owner":"nicolo-ribaudo","description":"A Webpack loader which extracts a single block from Vue single-file components","archived":false,"fork":false,"pushed_at":"2017-05-29T20:06:05.000Z","size":20,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-01T21:19:38.219Z","etag":null,"topics":["single-file-component","vue","vue-loader","vue-webpack","webpack","webpack-loader","webpack-vue"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicolo-ribaudo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-22T21:40:55.000Z","updated_at":"2019-09-27T19:29:29.000Z","dependencies_parsed_at":"2022-09-03T06:10:45.537Z","dependency_job_id":null,"html_url":"https://github.com/nicolo-ribaudo/vue-extract-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolo-ribaudo%2Fvue-extract-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolo-ribaudo%2Fvue-extract-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolo-ribaudo%2Fvue-extract-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolo-ribaudo%2Fvue-extract-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicolo-ribaudo","download_url":"https://codeload.github.com/nicolo-ribaudo/vue-extract-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441905,"owners_count":21104099,"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":["single-file-component","vue","vue-loader","vue-webpack","webpack","webpack-loader","webpack-vue"],"created_at":"2024-10-13T19:45:28.383Z","updated_at":"2025-04-11T16:39:25.453Z","avatar_url":"https://github.com/nicolo-ribaudo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-extraxt-loader\n\u003e A [Webpack](https://webpack.js.org) loader which extracts a single block from Vue single-file components.\n\n**What is the difference with [vue-loader](https://github.com/vuejs/vue-loader)?**\n\nBeside importing components, vue-loader can also load custom blocks. But you can't​ import only a custom block: vue-loader imports the whole file, and attaches the custom block to the component using an user-defined loader.\n\nOn the other hand, vue-extraxt-loader imports just the wanted block, ignoring the other parts of the file: this can be useful, for example, for importing a `\u003cunit-test\u003e` block from a testing framework.\n\n## Install\n\nYou can install this package either using yarn or npm:\n\n```\nyarn add --dev vue-extraxt-loader\n\n# or\n\nnpm install -D vue-extraxt-loader\n```\n\n## Usage\n\nYou can either use this loader inline, or add it to your `webpack.config.js` file.\n\n\u003ca name=\"warning-inline-loader\"\u003e\u003c/a\u003e\n\u003e ⚠️**WARNING**\n\u003e\n\u003e If `vue-extract-loader` and `vue-loader` are applied to the same import request, `vue-loader` gets ignored.\n\u003e This behavior can be useful if you set `vue-loader` for every `.vue` file, but you should ensure that `vue-extract-loader` doesn't get applied to too much paths.\n\u003e \n\u003e For this reason, it is recommended to use `vue-extract-loader` inline.\n\n### Options\n\n| Option | Required | Description |\n| ------------- |:-------------:| ----- |\n| `block` | ✔️ | The name of the tag to import  |\n\n### Examples and use cases\n\n01. [Basic](./examples/01-base/) - A basic example which shows how to use this loader.\n02. [vue-play](./examples/02-play) - Shows how to define an alias for the loader, so that you can `import \"vue-play-loader!./component.vue\"`.\n03. [Testing](./examples/03-play) - Sets the loader in `webpack.config.js`, without applying it to too much paths. (see [the previous warning](#warning-inline-loader))\n04. [Src import](./examples/04-src-import/) - This loader also works if the custom block specifies its value using the `src` attribute.\n05. [vue-play chunks splitting](./examples/05-play-chunks) - Like 02, but the component and the play block are in two different chunks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolo-ribaudo%2Fvue-extract-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolo-ribaudo%2Fvue-extract-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolo-ribaudo%2Fvue-extract-loader/lists"}