{"id":15637571,"url":"https://github.com/zephraph/vue-theme-loader","last_synced_at":"2025-08-21T00:30:38.333Z","repository":{"id":65412469,"uuid":"81511781","full_name":"zephraph/vue-theme-loader","owner":"zephraph","description":"A webpack loader for supporting multi-site theming with Vue.js","archived":false,"fork":false,"pushed_at":"2019-10-03T21:22:01.000Z","size":1172,"stargazers_count":105,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-10T03:40:37.439Z","etag":null,"topics":["theme","vue","vue-theme-loader","webpack-loader"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/zephraph.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-02-10T01:13:39.000Z","updated_at":"2023-10-10T19:25:08.000Z","dependencies_parsed_at":"2023-01-22T08:05:42.358Z","dependency_job_id":null,"html_url":"https://github.com/zephraph/vue-theme-loader","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephraph%2Fvue-theme-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephraph%2Fvue-theme-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephraph%2Fvue-theme-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephraph%2Fvue-theme-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephraph","download_url":"https://codeload.github.com/zephraph/vue-theme-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229908438,"owners_count":18142861,"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":["theme","vue","vue-theme-loader","webpack-loader"],"created_at":"2024-10-03T11:12:10.152Z","updated_at":"2024-12-19T17:08:48.500Z","avatar_url":"https://github.com/zephraph.png","language":"TypeScript","readme":"# vue-theme-loader [![Greenkeeper badge](https://badges.greenkeeper.io/zephraph/vue-theme-loader.svg)](https://greenkeeper.io/)\n\nA webpack loader for supporting multi-site theming with Vue.js\n\nGive styleblocks in Vue's single file components a theme attribute. Specify which theme you want to build for via an option to `vue-theme-loader`. All other unmatching themed style blocks will be removed. \n\nIn this example there is one non-themed block and two themed. Setting the theme option to `brand1` removes the `brand2` themed styleblock.\n\n*Before*\n\n```vue\n\u003c!-- Vue single component file --\u003e\n\n\u003cstyle\u003e\n  button {\n    border: 1px solid black;\n  }\n\u003c/style\u003e\n\n\u003cstyle theme=\"brand1\"\u003e\n  button {\n    color: red;\n  }\n\u003c/style\u003e\n\n\u003cstyle theme=\"brand2\"\u003e\n  button {\n    color: blue;\n  }\n\u003c/style\u003e\n```\n\n*After* (with the `theme` option set to brand1)\n\n```vue\n\u003c!-- Vue single component file --\u003e\n\n\u003cstyle\u003e\n  button {\n    border: 1px solid black;\n  }\n\u003c/style\u003e\n\n\u003cstyle theme=\"brand1\"\u003e\n  button {\n    color: red;\n  }\n\u003c/style\u003e\n```\n\n## Configuring webpack\n\nIt's important to remember that webpack resolves loaders from right to left so `vue-theme-loader` must always go under `vue-loader`. \n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n     {\n        test: /\\.vue$/,\n        use: [\n          {\n            loader: 'vue-loader'\n          },\n          { \n            loader: 'vue-theme-loader',\n            options: {\n              theme: 'brand1'\n            }\n          }\n        ]\n      }\n    ]\n  }\n};\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephraph%2Fvue-theme-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephraph%2Fvue-theme-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephraph%2Fvue-theme-loader/lists"}