{"bugs":{"url":"https://github.com/vuejs/vue-loader/issues"},"dist":{"shasum":"80f142a908540b093b30d6014b8f5105e94ad74a","tarball":"https://registry.npmjs.org/vue-loader/-/vue-loader-15.0.0-beta.3.tgz","fileCount":81,"integrity":"sha512-htOOsyyD8HdLXwAsME23GwOym2S028NFlZxaEtUdYwnPOmGrgiR25wAEzLUZp2NK922hinGVF1KiUg9vfOCwFQ==","signatures":[{"sig":"MEUCIFtFZUFtYZnzjB1RkApKUwizeBXUDZxGD49UWCT9AZoWAiEAm+im127frtkQf4uwq3XrZETI48uyOpIlq8RllScaT3I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":386271},"main":"lib/index.js","name":"vue-loader","author":{"name":"Evan You"},"readme":"# vue-loader@next\n\nThis is the WIP branch of the next version of `vue-loader`. It uses a fairly different new architecture that is able to apply whatever rules defined in the main webpack config to the language blocks inside a `*.vue` file.\n\n## Example Usage\n\n``` js\n// webpack.config.js\nconst path = require('path')\nconst { VueLoaderPlugin } = require('vue-loader')\n\nmodule.exports = {\n  mode: 'development',\n  module: {\n    rules: [\n      {\n        test: /\\.vue$/,\n        loader: 'vue-loader'\n      },\n      // this will apply to both plain .js files\n      // AND <script> blocks in vue files\n      {\n        test: /\\.js$/,\n        loader: 'babel-loader'\n      },\n      // this will apply to both plain .css files\n      // AND <style> blocks in vue files\n      {\n        test: /\\.css$/,\n        use: [\n          'vue-style-loader',\n          'css-loader'\n        ]\n      },\n      // this will apply to both plain .scss files\n      // AND <style lang=\"scss\"> blocks in vue files\n      {\n        test: /\\.scss$/,\n        use: [\n          'vue-style-loader',\n          'css-loader',\n          {\n            loader: 'sass-loader',\n            options: {\n              data: '$color: red;'\n            }\n          }\n        ]\n      }\n    ]\n  },\n  plugins: [\n    // make sure to include the plugin for the magic\n    new VueLoaderPlugin()\n  ]\n}\n```\n\n## Notable Breaking Changes\n\n### Loader Inference\n\n`vue-loader` 15 now infers loaders to use for language blocks a bit differently.\n\nTake `<style lang=\"less\">` as an example: in v14 and below, it will attempt to load the block with `less-loader`, and implicitly chains `css-loader` and `vue-style-loader` after it, all using inline loader strings.\n\nIn v15, `<style lang=\"less\">` will behave as if it's an actual `*.less` file being loaded. So, in order to process it, you need to provide an explicit rule in your main webpack config:\n\n``` js\n{\n  module: {\n    rules: [\n      // ...other rules\n      {\n        test: /\\.less$/,\n        use: [\n          'vue-style-loader',\n          'css-loader',\n          'less-loader'\n        ]\n      }\n    ]\n  }\n}\n```\n\nThe benefit is that this same rule also applies to plain `*.less` imports from JavaScript, and you can configure options for these loaders anyway you want. In v14 and below, if you want to provide custom options to an inferred loader, you'd have to duplicate it under `vue-loader`'s own `loaders` option. In v15 it is no longer necessary.\n\nv15 also allows using non-serializable options for loaders, which was not possible in previous versions.\n\n### Style Injection\n\nClient-side style injection now injects all styles upfront to ensure consistent behavior between development and extracted mode.\n\nNote the injection order is still not guaranteed, so you should avoid writing CSS that relies on insertion order.\n\n### PostCSS\n\n`vue-loader` no longer auto applies PostCSS transforms. To use PostCSS, configure `postcss-loader` the same way you would for normal CSS files.\n\n### CSS Modules\n\nCSS Modules now need to be explicitly configured via `css-loader` options. The `module` attribute on `<style>` tags is still needed for locals injection into the component.\n\nThe good news is that you can now configure `localIdentName` in one place:\n\n``` js\n{\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [\n          {\n            loader: 'vue-style-loader'\n          },\n          {\n            loader: 'css-loader',\n            options: {\n              modules: true,\n              localIdentName: '[local]_[hash:base64:8]'\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nIf you only want to use CSS Modules in some of your Vue components, you can use a `oneOf` rule and check for the `module` string in resourceQuery:\n\n``` js\n{\n  test: /\\.css$/,\n  oneOf: [\n    // this matches <style module>\n    {\n      resourceQuery: /module/,\n      use: [\n        'vue-style-loader',\n        {\n          loader: 'css-loader',\n          options: {\n            modules: true,\n            localIdentName: '[local]_[hash:base64:5]'\n          }\n        }\n      ]\n    },\n    // this matches plain <style> or <style scoped>\n    {\n      use: [\n        'vue-style-loader',\n        'css-loader'\n      ]\n    }\n  ]\n}\n```\n\n## CSS Extraction\n\nWorks the same way as you'd configure it for normal CSS. Example usage with [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin):\n\n``` js\n{\n  module: {\n    rules: [\n      {\n        test: /\\.vue$/,\n        use: 'vue-loader'\n      },\n      {\n        test: /\\.css$/,\n        // or ExtractTextWebpackPlugin.extract(...)\n        use: [\n          MiniCssExtractPlugin.loader,\n          'css-loader'\n        ]\n      }\n    ]\n  },\n  plugins: [\n    new MiniCssExtractPlugin({\n      filename: 'output.css'\n    })\n  ]\n}\n```\n\n## Options Deprecation\n\nThe following options have been deprecated and should be configured using normal webpack module rules:\n\n- `loader`\n- `preLoaders`\n- `postLoaders`\n- `postcss`\n- `cssSourceMap`\n- `buble`\n- `extractCSS`\n\nThe following options have been deprecated and should be configured using the new `compilerOptions` option:\n\n- `preserveWhitespace` (use `compilerOptions.preserveWhitespace`)\n- `compilerModules` (use `compilerOptions.modules`)\n- `compilerDirectives` (use `compilerOptions.directives`)\n\nThe following option has been renamed:\n\n- `transformToRequire` (now renamed to `transformAssetUrls`)\n\nThe following option has been changed to resourceQuery:\n\n- `shadowMode` (now use inline resource queries, e.g. `foo.vue?shadow`)\n\n## New Complete Options List\n\n- `compiler`\n- `compilerOptions`\n- `transpileOptions`\n- `transformAssetUrls`\n- `optimizeSSR`\n- `hotReload`\n- `productionMode`\n","gitHead":"81fc3bcd5a9a18e0bb55c57bd248aee129cf015b","license":"MIT","scripts":{"dev":"webpack-dev-server --config exploration/webpack.config.js --inline --hot","lint":"eslint lib test --fix","test":"jest --env node","build":"webpack --config exploration/webpack.config.js"},"_npmUser":{"name":"yyx990803","email":"yyx990803@gmail.com"},"gitHooks":{"pre-commit":"lint-staged"},"homepage":"https://github.com/vuejs/vue-loader","_npmVersion":"5.6.0","description":"Vue single-file component loader for Webpack","directories":{},"lint-staged":{"lib/**/*.js":["eslint --fix","git add"],"test/**/*.js":["eslint --fix","git add"]},"maintainers":[{"name":"yyx990803","email":"yyx990803@gmail.com"}],"_nodeVersion":"8.9.1","dependencies":{"hash-sum":"^1.0.2","loader-utils":"^1.1.0","vue-style-loader":"^4.1.0","vue-hot-reload-api":"^2.3.0","@vue/component-compiler-utils":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"pug":"^2.0.1","vue":"^2.5.16","jest":"^22.4.2","jsdom":"^11.6.2","eslint":"^4.19.0","stylus":"^0.54.5","yorkie":"^1.0.3","sugarss":"^1.0.1","webpack":"^4.1.0","node-sass":"^4.7.2","babel-core":"^6.26.0","css-loader":"^0.28.11","raw-loader":"^0.5.1","url-loader":"^1.0.1","file-loader":"^1.1.11","lint-staged":"^7.0.0","sass-loader":"^6.0.7","webpack-cli":"^2.0.10","babel-loader":"^7.1.4","stylus-loader":"^3.0.2","webpack-merge":"^4.1.2","postcss-loader":"^2.1.2","markdown-loader":"^2.0.2","babel-preset-env":"^1.6.1","normalize-newline":"^3.0.0","webpack-dev-server":"^3.1.1","vue-server-renderer":"^2.5.16","javascript-stringify":"^1.6.0","vue-template-compiler":"^2.5.16","eslint-plugin-vue-libs":"^2.1.0","mini-css-extract-plugin":"^0.2.0"},"peerDependencies":{"css-loader":"*","vue-template-compiler":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vue-loader_15.0.0-beta.3_1521836369781_0.8950291521283611","host":"s3://npm-registry-packages"},"_id":"vue-loader@15.0.0-beta.3","version":"15.0.0-beta.3"}