{"dist":{"shasum":"1766ea4516ea9598f244c2847e99aaf3de0fe20e","tarball":"https://registry.npmjs.org/vue-loader/-/vue-loader-17.1.0-beta.0.tgz","fileCount":40,"integrity":"sha512-cYRmQMCBJM7Rlb4UK1BTNsN2jYrOcvQF6zlmdQtwZQEHqgIpjzsh1STvxKDGJ4pbpLDEqCMRD0ct6lfQ0hTAtQ==","signatures":[{"sig":"MEUCIQCZn4bFq1UjCPz8nX7yZnswci3bUkeuWC+5pV2JJqm5YAIgC1FtmmNe7gk0itFPEduUBZyUuo6cWqmMeFjFPXzt228=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":95591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP07XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoC7g/+Iys0FZgPWwR2fadXgof7EOBhr8TiQimRfXiIv96tXk6jO9OJ\r\nNCldLulSRvMWmlWAqw9ajyREjGt/0ddyWdyrK7fuMMlWEl0mUeQV2PbizZaZ\r\n5hbFVmoFaVy2DXoGo4AD3Dh2eq8lwrTYBcrOgbA2w5Oav0JfClHjeDwrT2An\r\ncE/sUWg5CqyQ+oLw/JpENwXxsxzgLAoYMETdOlRthYaA3VQqZtQauYcQJKSf\r\nGURLdu1Ps7Ja7/lOcaRLnEgT367tOtGULHk7/TniB3MLZwQmX0QJDR8cZClu\r\n766oEn7tcMeR5fv/6qMBaDO9rEd/VebJmXSUSGNuqhmMiWc3/EEL07QlsdAk\r\nSL/0k6y+jOlJTBpI5fkf5cDDZ8d5N21bLfvVMyxk4d+7Z2e3RmQhGzeyWMMT\r\n0reU4hvpCApvks2wnNRI0eo+aKUtL7GBuPZkgxefh8yyGUJW8X/Om3Fef/fw\r\nD2J/C2XkytpRmnu2gsgVkgawAvl2xZf4rDvm1W6DaIEQLp2LvfPTQ+MWOupK\r\noUoZk8lRFHPLGXJln7tvCYyB/J5X7Z8hKZRaAjy0zu2Pxbq8vVb5cc2rlKyo\r\nd+6KkMoMZe9FxyN76M5MFQxfZc/I5IGh9+ML/sCpEQ8pypc4DgZDCFDx9xrr\r\n0+xxeKXPusprY0pdALirTqaZlmY0QRbCQYg=\r\n=KJll\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"vue-loader","types":"dist/index.d.ts","author":{"name":"Evan You"},"readme":"# vue-loader [![ci](https://github.com/vuejs/vue-loader/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/vuejs/vue-loader/actions/workflows/ci.yml)\n\n> webpack loader for Vue Single-File Components\n\n- [Documentation](https://vue-loader.vuejs.org)\n\n## v16+ Only Options\n\n- `reactivityTransform: boolean`: enable [Vue Reactivity Transform](https://github.com/vuejs/rfcs/discussions/369) (SFCs only).\n\n- ~~`refSugar: boolean`: **removed.** use `reactivityTransform` instead.~~\n\n- `customElement: boolean | RegExp`: enable custom elements mode. An SFC loaded in custom elements mode inlines its `<style>` tags as strings under the component's `styles` option. When used with `defineCustomElement` from Vue core, the styles will be injected into the custom element's shadow root.\n\n  - Default is `/\\.ce\\.vue$/`\n  - Setting to `true` will process all `.vue` files in custom element mode.\n\n- `enableTsInTemplate: boolean` (16.8+): allow TS expressions in templates when `<script>` has `lang=\"ts\"`. Defaults to `true`.\n\n  - When used with `ts-loader`, due to `ts-loader`'s cache invalidation behavior, it sometimes prevents the template from being hot-reloaded in isolation, causing the component to reload despite only the template being edited. If this is annoying, you can set this option to `false` (and avoid using TS expressions in templates).\n\n  - Alternatively, leave this option on (by default) and use [`esbuild-loader`](https://github.com/privatenumber/esbuild-loader) to transpile TS instead, which doesn't suffer from this problem (it's also a lot faster). However, do note you will need to rely on TS type checking from other sources (e.g. IDE or `vue-tsc`).\n\n## What is Vue Loader?\n\n`vue-loader` is a loader for [webpack](https://webpack.js.org/) that allows you to author Vue components in a format called [Single-File Components (SFCs)](./docs/spec.md):\n\n```vue\n<template>\n  <div class=\"example\">{{ msg }}</div>\n</template>\n\n<script>\nexport default {\n  data() {\n    return {\n      msg: 'Hello world!',\n    }\n  },\n}\n</script>\n\n<style>\n.example {\n  color: red;\n}\n</style>\n```\n\nThere are many cool features provided by `vue-loader`:\n\n- Allows using other webpack loaders for each part of a Vue component, for example Sass for `<style>` and Pug for `<template>`;\n- Allows custom blocks in a `.vue` file that can have custom loader chains applied to them;\n- Treat static assets referenced in `<style>` and `<template>` as module dependencies and handle them with webpack loaders;\n- Simulate scoped CSS for each component;\n- State-preserving hot-reloading during development.\n\nIn a nutshell, the combination of webpack and `vue-loader` gives you a modern, flexible and extremely powerful front-end workflow for authoring Vue.js applications.\n\n## How It Works\n\n> The following section is for maintainers and contributors who are interested in the internal implementation details of `vue-loader`, and is **not** required knowledge for end users.\n\n`vue-loader` is not a simple source transform loader. It handles each language blocks inside an SFC with its own dedicated loader chain (you can think of each block as a \"virtual module\"), and finally assembles the blocks together into the final module. Here's a brief overview of how the whole thing works:\n\n1. `vue-loader` parses the SFC source code into an _SFC Descriptor_ using `@vue/compiler-sfc`. It then generates an import for each language block so the actual returned module code looks like this:\n\n   ```js\n   // code returned from the main loader for 'source.vue'\n\n   // import the <template> block\n   import render from 'source.vue?vue&type=template'\n   // import the <script> block\n   import script from 'source.vue?vue&type=script'\n   export * from 'source.vue?vue&type=script'\n   // import <style> blocks\n   import 'source.vue?vue&type=style&index=1'\n\n   script.render = render\n   export default script\n   ```\n\n   Notice how the code is importing `source.vue` itself, but with different request queries for each block.\n\n2. We want the content in `script` block to be treated like `.js` files (and if it's `<script lang=\"ts\">`, we want to to be treated like `.ts` files). Same for other language blocks. So we want webpack to apply any configured module rules that matches `.js` also to requests that look like `source.vue?vue&type=script`. This is what `VueLoaderPlugin` (`src/plugins.ts`) does: for each module rule in the webpack config, it creates a modified clone that targets corresponding Vue language block requests.\n\n   Suppose we have configured `babel-loader` for all `*.js` files. That rule will be cloned and applied to Vue SFC `<script>` blocks as well. Internally to webpack, a request like\n\n   ```js\n   import script from 'source.vue?vue&type=script'\n   ```\n\n   Will expand to:\n\n   ```js\n   import script from 'babel-loader!vue-loader!source.vue?vue&type=script'\n   ```\n\n   Notice the `vue-loader` is also matched because `vue-loader` are applied to `.vue` files.\n\n   Similarly, if you have configured `style-loader` + `css-loader` + `sass-loader` for `*.scss` files:\n\n   ```html\n   <style scoped lang=\"scss\">\n   ```\n\n   Will be returned by `vue-loader` as:\n\n   ```js\n   import 'source.vue?vue&type=style&index=1&scoped&lang=scss'\n   ```\n\n   And webpack will expand it to:\n\n   ```js\n   import 'style-loader!css-loader!sass-loader!vue-loader!source.vue?vue&type=style&index=1&scoped&lang=scss'\n   ```\n\n3. When processing the expanded requests, the main `vue-loader` will get invoked again. This time though, the loader notices that the request has queries and is targeting a specific block only. So it selects (`src/select.ts`) the inner content of the target block and passes it on to the loaders matched after it.\n\n4. For the `<script>` block, this is pretty much it. For `<template>` and `<style>` blocks though, a few extra tasks need to be performed:\n\n   - We need to compile the template using the Vue template compiler;\n   - We need to post-process the CSS in `<style scoped>` blocks, **after** `css-loader` but **before** `style-loader`.\n\n   Technically, these are additional loaders (`src/templateLoader.ts` and `src/stylePostLoader.ts`) that need to be injected into the expanded loader chain. It would be very complicated if the end users have to configure this themselves, so `VueLoaderPlugin` also injects a global [Pitching Loader](https://webpack.js.org/api/loaders/#pitching-loader) (`src/pitcher.ts`) that intercepts Vue `<template>` and `<style>` requests and injects the necessary loaders. The final requests look like the following:\n\n   ```js\n   // <template lang=\"pug\">\n   import 'vue-loader/template-loader!pug-loader!source.vue?vue&type=template'\n\n   // <style scoped lang=\"scss\">\n   import 'style-loader!vue-loader/style-post-loader!css-loader!sass-loader!vue-loader!source.vue?vue&type=style&index=1&scoped&lang=scss'\n   ```\n","license":"MIT","scripts":{"dev":"tsc --watch","lint":"prettier --write --parser typescript \"{src,test}/**/*.{j,t}s\"","test":"jest","build":"tsc","pretest":"tsc","dev-example":"node example/devServer.js --config example/webpack.config.js --inline --hot","build-example":"rm -rf example/dist && webpack --config example/webpack.config.js --env.prod","test:webpack4":"WEBPACK4=true jest","prepublishOnly":"tsc && conventional-changelog -p angular -i CHANGELOG.md -s -r 2","pretest:webpack4":"tsc","build-example-ssr":"rm -rf example/dist-ssr && webpack --config example/webpack.config.js --env.prod --env.ssr && node example/ssr.js"},"_npmUser":{"name":"yyx990803","email":"yyx990803@gmail.com"},"gitHooks":{"pre-commit":"lint-staged"},"repository":{"url":"https://github.com/vuejs/vue-loader.git","type":"git"},"description":"> webpack loader for Vue Single-File Components","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2019-present, Yuxi (Evan) You\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","lint-staged":{"*.js":["prettier --write"],"*.ts":["prettier --parser=typescript --write"]},"maintainers":[{"name":"yyx990803","email":"yyx990803@gmail.com"},{"name":"soda","email":"npm@haoqun.me"}],"dependencies":{"chalk":"^4.1.0","hash-sum":"^2.0.0","watchpack":"^2.4.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"pug":"^2.0.0","vue":"^3.3.0-alpha.12","jest":"^26.4.1","jsdom":"^16.4.0","memfs":"^3.1.2","stylus":"^0.54.7","yorkie":"^2.0.0","sugarss":"^3.0.1","ts-jest":"^26.2.0","webpack":"^5.79.0","prettier":"^2.1.1","vue-i18n":"^9.1.7","webpack4":"npm:webpack@^4.46.0","ts-loader":"^8.0.6","css-loader":"^4.3.0","source-map":"^0.6.1","typescript":"^4.4.3","url-loader":"^4.1.0","@babel/core":"^7.7.7","@types/jest":"^26.0.13","file-loader":"^6.1.0","lint-staged":"^10.3.0","null-loader":"^4.0.1","webpack-cli":"^3.3.12","@types/jsdom":"^16.2.13","babel-loader":"^8.1.0","cache-loader":"^4.1.0","style-loader":"^2.0.0","ts-loader-v9":"npm:ts-loader@^9.2.4","@types/estree":"^0.0.45","stylus-loader":"^4.1.1","webpack-merge":"^5.1.4","postcss-loader":"^4.0.4","@types/hash-sum":"^1.0.0","markdown-loader":"^6.0.0","pug-plain-loader":"^1.0.0","@babel/preset-env":"^7.11.5","normalize-newline":"^3.0.0","webpack-dev-server":"^3.11.3","html-webpack-plugin":"^4.5.0","@types/webpack-merge":"^4.1.5","html-webpack-plugin-v5":"npm:html-webpack-plugin@^5.3.2","mini-css-extract-plugin":"^1.6.2","@intlify/vue-i18n-loader":"^3.0.0","conventional-changelog-cli":"^2.1.1","@types/mini-css-extract-plugin":"^0.9.1"},"peerDependencies":{"webpack":"^4.1.0 || ^5.0.0-0"},"peerDependenciesMeta":{"vue":{"optional":true},"@vue/compiler-sfc":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/vue-loader_17.1.0-beta.0_1681870551732_0.25064803605283115","host":"s3://npm-registry-packages"},"_id":"vue-loader@17.1.0-beta.0","version":"17.1.0-beta.0"}