[
  {
    "path": ".editorconfig",
    "content": "# editorconfig.org\nroot = true\n\n[*]\nindent_size = 2\nindent_style = space\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  parserOptions: {\n    parser: 'babel-eslint',\n    sourceType: 'module'\n  },\n  extends: [\n    '@nuxtjs'\n  ],\n  rules: {\n    'vue/attribute-hyphenation': ['error', 'always', {\n      ignore: ['viewBox']\n    }]\n  }\n}\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: [manniL]\ncustom: ['https://www.lichter.io/support-me/']\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\n*.iml\n.idea\n*.log*\n.nuxt\n.vscode\n.DS_STORE\ncoverage\ndist"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n- \"8\"\n- \"9\"\n- \"10\"\ncache:\n  yarn: true\n  directories:\n  - node_modules\ninstall:\n- yarn\nscript:\n- yarn test\nafter_success:\n- yarn coverage\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Change Log\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n\n<a name=\"1.2.0\"></a>\n# [1.2.0](https://github.com/Developmint/nuxt-svg-loader/compare/v1.0.1...v1.2.0) (2020-01-22)\n\n\n### Bug Fixes\n\n* revert df4be5 to fix regex ([465298a](https://github.com/Developmint/nuxt-svg-loader/commit/465298a))\n* use image name function when using inline query ([c90a8ed](https://github.com/Developmint/nuxt-svg-loader/commit/c90a8ed))\n\n\n### Features\n\n* proper loading svg used as background url ([#50](https://github.com/Developmint/nuxt-svg-loader/issues/50)) ([9df6300](https://github.com/Developmint/nuxt-svg-loader/commit/9df6300))\n\n\n\n<a name=\"1.1.0\"></a>\n# [1.1.0](https://github.com/Developmint/nuxt-svg-loader/compare/v1.0.1...v1.1.0) (2020-01-22)\n\n\n### Bug Fixes\n\n* use image name function when using inline query ([c90a8ed](https://github.com/Developmint/nuxt-svg-loader/commit/c90a8ed))\n\n\n### Features\n\n* proper loading svg used as background url ([#50](https://github.com/Developmint/nuxt-svg-loader/issues/50)) ([9df6300](https://github.com/Developmint/nuxt-svg-loader/commit/9df6300))\n\n\n\n<a name=\"1.0.1\"></a>\n## [1.0.1](https://github.com/Developmint/nuxt-svg-loader/compare/v1.0.0...v1.0.1) (2019-01-11)\n\n\n### Bug Fixes\n\n* re-enable lazy-loading capabilities ([#28](https://github.com/Developmint/nuxt-svg-loader/issues/28)) ([e7928ab](https://github.com/Developmint/nuxt-svg-loader/commit/e7928ab))\n\n\n\n<a name=\"1.0.0\"></a>\n# [1.0.0](https://github.com/Developmint/nuxt-svg-loader/compare/v0.1.0...v1.0.0) (2019-01-09)\n\n\n### Bug Fixes\n\n* check if options is a thing ([ec9999f](https://github.com/Developmint/nuxt-svg-loader/commit/ec9999f))\n\n\n### Features\n\n* replaced vue-svg-loader with svg-to-vue-component ([#19](https://github.com/Developmint/nuxt-svg-loader/issues/19)) ([6061109](https://github.com/Developmint/nuxt-svg-loader/commit/6061109))\n* use default options from svg-to-vue and add svgo backwards compat ([84a84b7](https://github.com/Developmint/nuxt-svg-loader/commit/84a84b7))\n\n\n\n<a name=\"0.1.0\"></a>\n# [0.1.0](https://github.com/Developmint/nuxt-svg-loader/compare/v0.0.1...v0.1.0) (2018-11-05)\n\n\n### Features\n\n* pass custom loader options if needed ([071edce](https://github.com/Developmint/nuxt-svg-loader/commit/071edce))\n\n\n\n<a name=\"0.0.1\"></a>\n## 0.0.1 (2018-10-14)\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) Alexander Lichter <github@lichter.io>\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"
  },
  {
    "path": "README.md",
    "content": "# Nuxt SVG Loader - SVGs as components, also on the server side!\n[![npm (scoped with tag)](https://img.shields.io/npm/v/nuxt-svg-loader/latest.svg?style=flat-square)](https://npmjs.com/package/nuxt-svg-loader)\n[![npm](https://img.shields.io/npm/dt/nuxt-svg-loader.svg?style=flat-square)](https://npmjs.com/package/nuxt-svg-loader)\n[![Build Status](https://travis-ci.com/Developmint/nuxt-svg-loader.svg?branch=master)](https://travis-ci.com/Developmint/nuxt-svg-loader)\n[![codecov](https://codecov.io/gh/Developmint/nuxt-svg-loader/branch/master/graph/badge.svg)](https://codecov.io/gh/Developmint/nuxt-svg-loader)\n[![Dependencies](https://david-dm.org/Developmint/nuxt-svg-loader/status.svg?style=flat-square)](https://david-dm.org/Developmint/nuxt-svg-loader)\n[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com)\n [![thanks](https://img.shields.io/badge/thanks-%E2%99%A5-ff69b4.svg)](https://thanks.lichter.io/)\n\n>\n\n[📖 **Release Notes**](./CHANGELOG.md)\n\n## Features\n\n* Full support of SVGs as components. Import them like your Vue SFCs\n* Use Vue bindings as you'd do it with normal components\n* Built on top of [svg-to-vue-component](https://github.com/egoist/svg-to-vue-component)\n* Nuxt 2 (and only Nuxt 2) support\n* Fully tested!\n\n## Demo\n\nA live demo is available through the [CodeSandBox](https://codesandbox.io/s/github/Developmint/nuxt-svg-loader/tree/master) of the repo.\n\n## Setup\n\n- Add `nuxt-svg-loader` as a dependency using yarn or npm to your project\n- Add `nuxt-svg-loader` to `modules` section of `nuxt.config.js`\n\n```js\n{\n  modules: [\n    'nuxt-svg-loader',\n  ]\n}\n```\n\n- Now you can use your svg files like regular Vue components\n- You can use inline svg as well by adding `?inline` at the end of the file path\n```\n<template>\n  <nav>\n    <a href=\"https://github.com/vuejs/vue\">\n      <VueLogo />\n      Vue\n    </a>\n    <a href=\"https://github.com/svg/svgo\">\n      <SVGOLogo />\n      SVGO\n    </a>\n    <a href=\"https://github.com/webpack/webpack\">\n      <WebpackLogo />\n      webpack\n    </a>\n    <!-- Inline svg -->\n    <a class=\"with-background-svg\" href=\"https://github.com/webpack/webpack\">\n      webpack\n    </a>\n    <a href=\"https://github.com/webpack/webpack\">\n      <img src=\"../components/NuxtTwo.svg?inline\">\n      webpack>\n    </a>\n  </nav>\n</template>\n<script>\nimport VueLogo from '@/assets/svg/vue.svg';\nimport SVGOLogo from '@/assets/svg/svgo.svg';\nimport WebpackLogo from '@/assets/svg/webpack.svg';\n\nexport default {\n  name: 'Example',\n  components: {\n    VueLogo,\n    SVGOLogo,\n    WebpackLogo,\n  }\n};\n</script>\n<style>\n.with-background-svg {\n  background: url('@/assets/svg/vue.svg?inline')\n}\n</style>\n```\n\n- No more options are needed. It'll simply work\n\n## Configuration\n\nThe plugin will work seamlessly out of the box.\nIt will also include SVGO defaults to avoid collisions between your optimized SVG files!\n \nIf you want to configure the underlying loader (or SVGO), you can do that easily as well.\n(All options available [here](https://github.com/egoist/svg-to-vue-component#loader-options))\n\n```js\n// file: nuxt.config.js\n\nexport default {\n  // ...\n  // Your loader options as svgLoader object\n  svgLoader: {\n    svgoConfig: {\n      plugins: [\n        { prefixIds: false } // Disables prefixing for SVG IDs\n      ]\n    }\n  }\n}\n```\n\n## Migrating from 0.x\n\n1. Update the deps (of course!)\n2. Rename `svgo` to `svgoConfig`\n3. If you used id prefixing manually before, you can delete the config:\n\n```js\nexport default {\n  svgLoader: {\n    svgo: { //Rename to svgoConfig  \n      plugins: [\n        { prefixIds: true } // Delete that line (or the whole svgLoader object if you don't have any other configurations)\n      ]\n    }\n  }\n}\n```\n\n## How to fix Eslint auto lint error\nIf you turn on Eslint on save by server, you should exclude `.svg` files of `eslint-loader`.\n\nExample:\n```js\n// nuxt.config.js\nbuild: {\n    extend(config, ctx) {\n    // Run ESLint on save\n    if (ctx.isDev && ctx.isClient) {\n      config.module.rules.push({\n        enforce: 'pre',\n        test: /\\.(js|vue)$/,\n        loader: 'eslint-loader',\n        exclude: /(node_modules)|(\\.svg$)/ /* <--- here */\n      })\n    }\n  }\n}\n```\n\n## Development\n\n- Clone this repository\n- Install dependencies using `yarn install` or `npm install`\n- Start development server using `npm run dev`\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Alexander Lichter\n"
  },
  {
    "path": "commitlint.config.js",
    "content": "module.exports = { extends: ['@commitlint/config-conventional'] }\n"
  },
  {
    "path": "lib/module.js",
    "content": "const logger = require('consola').withScope('nuxt-svg-loader')\n\nexport default function nuxtSvgLoader(moduleOptions) {\n  const options = Object.assign({}, this.options.svgLoader, moduleOptions)\n\n  if (options && options.svgo && !options.svgoConfig) {\n    options.svgoConfig = options.svgo\n  }\n\n  const fileName = this.nuxt.options.build.filenames.img(this.nuxt.options.dev)\n\n  this.extendBuild(setupVueSvgLoader(options, fileName))\n}\n\nconst svgRulePredicate = rule => rule.test && rule.test.test('.svg')\n\nconst setupVueSvgLoader = (options, fileName) => (config) => {\n  // https://github.com/egoist/svg-to-vue-component#nuxtjs-2\n  const imageLoaderRule = config.module.rules.find(svgRulePredicate)\n\n  if (!imageLoaderRule) {\n    logger.error('Could not modify image loader rule!')\n    return\n  }\n\n  // Don't process .svg files in default image rule\n  // from https://github.com/nuxt/nuxt.js/blob/76b10d2d3f4e5352f1c9d14c52008f234e66d7d5/lib/builder/webpack/base.js#L203\n  imageLoaderRule.test = /\\.(png|jpe?g|gif|webp)$/\n\n  // Add a new rule for .svg file\n  config.module.rules.push({\n    test: /\\.svg$/,\n    oneOf: [\n      {\n        resourceQuery: /inline/,\n        use: {\n            loader: \"file-loader\",\n            options: {\n              esModule: false,\n              name: fileName\n            },\n        },\n      },\n      {\n        use: [\n          'vue-loader',\n          {\n            loader: 'svg-to-vue-component/loader',\n            options\n          }\n        ]\n      }\n    ]\n  })\n}\n\nmodule.exports.meta = require('../package.json')\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"nuxt-svg-loader\",\n  \"version\": \"1.2.0\",\n  \"description\": \"\",\n  \"license\": \"MIT\",\n  \"contributors\": [\n    {\n      \"name\": \"Alexander Lichter <npm@lichter.io>\"\n    }\n  ],\n  \"main\": \"lib/module.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/Developmint/nuxt-svg-loader\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/Developmint/nuxt-svg-loader/issues\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"dev\": \"nuxt --config-file test/fixture/configs/default.js\",\n    \"lint\": \"eslint lib test\",\n    \"test\": \"yarn run lint && jest --detectOpenHandles\",\n    \"release\": \"standard-version && git push --follow-tags && npm publish\",\n    \"commitlint\": \"commitlint -e $GIT_PARAMS\",\n    \"coverage\": \"codecov\"\n  },\n  \"eslintIgnore\": [\n    \"lib/templates/*.*\"\n  ],\n  \"files\": [\n    \"lib\"\n  ],\n  \"keywords\": [\n    \"nuxtjs\",\n    \"nuxt\",\n    \"nuxt-module\",\n    \"svg\",\n    \"loader\",\n    \"svg-loader\"\n  ],\n  \"engines\": {\n    \"node\": \">=8.0.0\",\n    \"npm\": \">=5.0.0\"\n  },\n  \"jest\": {\n    \"testEnvironment\": \"node\",\n    \"collectCoverage\": true,\n    \"coveragePathIgnorePatterns\": [\n      \"/node_modules/\",\n      \"/test/fixture\"\n    ],\n    \"forceExit\": true\n  },\n  \"dependencies\": {\n    \"consola\": \"^2.3.2\",\n    \"svg-to-vue-component\": \"^0.3.1\"\n  },\n  \"devDependencies\": {\n    \"@commitlint/cli\": \"^7.3.1\",\n    \"@commitlint/config-conventional\": \"^7.3.1\",\n    \"@nuxtjs/eslint-config\": \"^0.0.1\",\n    \"babel-eslint\": \"^10.0.1\",\n    \"codecov\": \"^3.1.0\",\n    \"eslint\": \"^5.12.0\",\n    \"eslint-config-standard\": \"^12.0.0\",\n    \"eslint-plugin-import\": \"^2.14.0\",\n    \"eslint-plugin-jest\": \"^22.1.3\",\n    \"eslint-plugin-node\": \"^8.0.1\",\n    \"eslint-plugin-promise\": \"^4.0.1\",\n    \"eslint-plugin-standard\": \"^4.0.0\",\n    \"eslint-plugin-vue\": \"^5.1.0\",\n    \"get-port\": \"^4.1.0\",\n    \"husky\": \"^1.3.1\",\n    \"jest\": \"^23.6.0\",\n    \"jsdom\": \"^13.1.0\",\n    \"nuxt-edge\": \"^2.4.0-25786640.3ebd6b70\",\n    \"standard-version\": \"^4.4.0\"\n  },\n  \"husky\": {\n    \"hooks\": {\n      \"pre-commit\": \"yarn run lint\",\n      \"commit-msg\": \"yarn run commitlint\"\n    }\n  }\n}\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"extends\": [\n    \"@nuxtjs\"\n  ]\n}\n"
  },
  {
    "path": "test/__snapshots__/module.test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`ssr correctly load SVG as background image 1`] = `\n\"<!doctype html>\n<html data-n-head-ssr data-n-head=\\\\\"\\\\\">\n  <head data-n-head=\\\\\"\\\\\">\n    <title data-n-head=\\\\\"true\\\\\"></title><style data-vue-ssr-id=\\\\\"17cfdfa9:0\\\\\">.nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;opacity:1;transition:width .1s,opacity .4s;background-color:#000;z-index:999999}.nuxt-progress.nuxt-progress-notransition{transition:none}.nuxt-progress-failed{background-color:red}</style><style data-vue-ssr-id=\\\\\"7bcfa2f0:0\\\\\">h1{background:url(/_nuxt/img/a88f1f4.svg)}</style>\n  </head>\n  <body data-n-head=\\\\\"\\\\\">\n    <div data-server-rendered=\\\\\"true\\\\\" id=\\\\\"__nuxt\\\\\"><!----><div id=\\\\\"__layout\\\\\"><div><h1>-</h1> <h2>-</h2></div></div></div><script>window.__NUXT__={layout:\\\\\"default\\\\\",data:[{}],error:null,serverRendered:true};</script><script src=\\\\\"/_nuxt/runtime.js\\\\\" defer></script><script src=\\\\\"/_nuxt/pages/background-image.js\\\\\" defer></script><script src=\\\\\"/_nuxt/commons.app.js\\\\\" defer></script><script src=\\\\\"/_nuxt/app.js\\\\\" defer></script>\n  </body>\n</html>\n\"\n`;\n\nexports[`ssr correctly load two lazy-loaded SVGs 1`] = `\n\"<!doctype html>\n<html data-n-head-ssr data-n-head=\\\\\"\\\\\">\n  <head data-n-head=\\\\\"\\\\\">\n    <title data-n-head=\\\\\"true\\\\\"></title><style data-vue-ssr-id=\\\\\"17cfdfa9:0\\\\\">.nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;opacity:1;transition:width .1s,opacity .4s;background-color:#000;z-index:999999}.nuxt-progress.nuxt-progress-notransition{transition:none}.nuxt-progress-failed{background-color:red}</style>\n  </head>\n  <body data-n-head=\\\\\"\\\\\">\n    <div data-server-rendered=\\\\\"true\\\\\" id=\\\\\"__nuxt\\\\\"><!----><div id=\\\\\"__layout\\\\\"><div><svg xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"1 2 3 4\\\\\" width=\\\\\"100\\\\\"><g id=\\\\\"Nuxt_svg__nuxt\\\\\"><path d=\\\\\"M317.9 852H3.7l408.1-704 408.1 704H507.7\\\\\" fill=\\\\\"#41b883\\\\\"></path><path d=\\\\\"M779.8 852h216.5l-354-608.5-351 608.5h216.5\\\\\" fill=\\\\\"#328170\\\\\"></path><path d=\\\\\"M651.2 852h159.5L549.9 403.8 291.3 852h159.5\\\\\" fill=\\\\\"#35495e\\\\\"></path></g></svg> <svg xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"0 0 1000 1000\\\\\"><g id=\\\\\"NuxtTwo_svg__nuxt\\\\\"><path d=\\\\\"M317.9 852H3.7l408.1-704 408.1 704H507.7\\\\\" fill=\\\\\"#41b883\\\\\"></path><path d=\\\\\"M779.8 852h216.5l-354-608.5-351 608.5h216.5\\\\\" fill=\\\\\"#328170\\\\\"></path><path d=\\\\\"M651.2 852h159.5L549.9 403.8 291.3 852h159.5\\\\\" fill=\\\\\"#35495e\\\\\"></path></g></svg></div></div></div><script>window.__NUXT__={layout:\\\\\"default\\\\\",data:[{}],error:null,serverRendered:true};</script><script src=\\\\\"/_nuxt/runtime.js\\\\\" defer></script><script src=\\\\\"/_nuxt/pages/two.js\\\\\" defer></script><script src=\\\\\"/_nuxt/7.js\\\\\" defer></script><script src=\\\\\"/_nuxt/commons.app.js\\\\\" defer></script><script src=\\\\\"/_nuxt/app.js\\\\\" defer></script>\n  </body>\n</html>\n\"\n`;\n\nexports[`ssr honor custom build.extend function 1`] = `\n\"<!doctype html>\n<html data-n-head-ssr data-n-head=\\\\\"\\\\\">\n  <head data-n-head=\\\\\"\\\\\">\n    <title data-n-head=\\\\\"true\\\\\"></title><style data-vue-ssr-id=\\\\\"17cfdfa9:0\\\\\">.nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;opacity:1;transition:width .1s,opacity .4s;background-color:#000;z-index:999999}.nuxt-progress.nuxt-progress-notransition{transition:none}.nuxt-progress-failed{background-color:red}</style>\n  </head>\n  <body data-n-head=\\\\\"\\\\\">\n    <div data-server-rendered=\\\\\"true\\\\\" id=\\\\\"__nuxt\\\\\"><!----><div id=\\\\\"__layout\\\\\"><svg xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"1 2 3 4\\\\\" width=\\\\\"100\\\\\"><g id=\\\\\"Nuxt_svg__nuxt\\\\\"><path d=\\\\\"M317.9 852H3.7l408.1-704 408.1 704H507.7\\\\\" fill=\\\\\"#41b883\\\\\"></path><path d=\\\\\"M779.8 852h216.5l-354-608.5-351 608.5h216.5\\\\\" fill=\\\\\"#328170\\\\\"></path><path d=\\\\\"M651.2 852h159.5L549.9 403.8 291.3 852h159.5\\\\\" fill=\\\\\"#35495e\\\\\"></path></g></svg></div></div><script>window.__NUXT__={layout:\\\\\"default\\\\\",data:[{}],error:null,serverRendered:true};</script><script src=\\\\\"/_nuxt/runtime.js\\\\\" defer></script><script src=\\\\\"/_nuxt/pages/index.js\\\\\" defer></script><script src=\\\\\"/_nuxt/commons.app.js\\\\\" defer></script><script src=\\\\\"/_nuxt/app.js\\\\\" defer></script>\n  </body>\n</html>\n\"\n`;\n\nexports[`ssr honor custom loader options 1`] = `\n\"<!doctype html>\n<html data-n-head-ssr data-n-head=\\\\\"\\\\\">\n  <head data-n-head=\\\\\"\\\\\">\n    <title data-n-head=\\\\\"true\\\\\"></title><style data-vue-ssr-id=\\\\\"17cfdfa9:0\\\\\">.nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;opacity:1;transition:width .1s,opacity .4s;background-color:#000;z-index:999999}.nuxt-progress.nuxt-progress-notransition{transition:none}.nuxt-progress-failed{background-color:red}</style>\n  </head>\n  <body data-n-head=\\\\\"\\\\\">\n    <div data-server-rendered=\\\\\"true\\\\\" id=\\\\\"__nuxt\\\\\"><!----><div id=\\\\\"__layout\\\\\"><svg xmlns=\\\\\"http://www.w3.org/2000/svg\\\\\" viewBox=\\\\\"1 2 3 4\\\\\" width=\\\\\"100\\\\\"><g id=\\\\\"nuxt\\\\\"><path d=\\\\\"M317.9 852H3.7l408.1-704 408.1 704H507.7\\\\\" fill=\\\\\"#41b883\\\\\"></path><path d=\\\\\"M779.8 852h216.5l-354-608.5-351 608.5h216.5\\\\\" fill=\\\\\"#328170\\\\\"></path><path d=\\\\\"M651.2 852h159.5L549.9 403.8 291.3 852h159.5\\\\\" fill=\\\\\"#35495e\\\\\"></path></g></svg></div></div><script>window.__NUXT__={layout:\\\\\"default\\\\\",data:[{}],error:null,serverRendered:true};</script><script src=\\\\\"/_nuxt/runtime.js\\\\\" defer></script><script src=\\\\\"/_nuxt/pages/index.js\\\\\" defer></script><script src=\\\\\"/_nuxt/commons.app.js\\\\\" defer></script><script src=\\\\\"/_nuxt/app.js\\\\\" defer></script>\n  </body>\n</html>\n\"\n`;\n"
  },
  {
    "path": "test/fixture/configs/default.js",
    "content": "const { resolve } = require('path')\n\nmodule.exports = {\n  rootDir: resolve(__dirname, '../../../'),\n  srcDir: resolve(__dirname, '../'),\n  render: {\n    resourceHints: false\n  },\n  modules: ['@@'],\n  build: {\n    filenames: {\n      app: '[name].js',\n      chunk: '[name].js'\n    }\n  }\n}\n"
  },
  {
    "path": "test/fixture/configs/error-without-image-loader-rule.js",
    "content": "const { resolve } = require('path')\n\nmodule.exports = {\n  rootDir: resolve(__dirname, '../../../'),\n  srcDir: resolve(__dirname, '../'),\n  render: {\n    resourceHints: false\n  },\n  modules: ['@@', '@/modules/error'],\n  build: {\n    quiet: false,\n    filenames: {\n      app: '[name].js',\n      chunk: '[name].js'\n    }\n  }\n}\n"
  },
  {
    "path": "test/fixture/configs/with-extend-fn.js",
    "content": "const { resolve } = require('path')\nconst consola = require('consola')\n\nmodule.exports = {\n  rootDir: resolve(__dirname, '../../../'),\n  srcDir: resolve(__dirname, '../'),\n  render: {\n    resourceHints: false\n  },\n  modules: ['@@'],\n  build: {\n    quiet: false,\n    filenames: {\n      app: '[name].js',\n      chunk: '[name].js'\n    },\n    extend() {\n      consola.fatal('Build fn')\n    }\n  }\n}\n"
  },
  {
    "path": "test/fixture/configs/with-options.js",
    "content": "const { resolve } = require('path')\n\nmodule.exports = {\n  rootDir: resolve(__dirname, '../../../'),\n  srcDir: resolve(__dirname, '../'),\n  render: {\n    resourceHints: false\n  },\n  modules: ['@@'],\n  svgLoader: {\n    svgo: {\n      plugins: [\n        { prefixIds: false }\n      ]\n    }\n  },\n  build: {\n    filenames: {\n      app: '[name].js',\n      chunk: '[name].js'\n    }\n  }\n}\n"
  },
  {
    "path": "test/fixture/modules/error.js",
    "content": "module.exports = function () {\n  const svgRulePredicate = rule => rule.test && rule.test.test('.svg')\n  this.extendBuild((config) => {\n    const imageLoaderRule = config.module.rules.find(svgRulePredicate)\n    imageLoaderRule.test = /^$/\n  })\n}\n"
  },
  {
    "path": "test/fixture/modules/main.css",
    "content": "h2 {\n  background: url('../components/NuxtTwo.svg?inline')\n}"
  },
  {
    "path": "test/fixture/pages/background-image.vue",
    "content": "<template>\n  <div>\n    <h1>-</h1>\n    <h2>-</h2>\n  </div>\n</template>\n\n<script>\nimport '../modules/main.css'\nexport default {\n  loading: false,\n}\n</script>\n\n<style>\nh1 {\n  background: url('../components/NuxtTwo.svg?inline')\n}\n</style>\n\n"
  },
  {
    "path": "test/fixture/pages/index.vue",
    "content": "<template>\n  <nuxt-logo viewBox=\"1 2 3 4\" width=\"100\" />\n</template>\n\n<script>\nimport NuxtLogo from '../components/Nuxt.svg'\nexport default {\n  loading: false,\n  components: {\n    NuxtLogo\n  }\n}\n</script>\n"
  },
  {
    "path": "test/fixture/pages/two.vue",
    "content": "<template>\n  <div>\n    <nuxt-logo viewBox=\"1 2 3 4\" width=\"100\" />\n    <nuxt-logo-two />\n  </div>\n</template>\n\n<script>\nexport default {\n  loading: false,\n  components: {\n    NuxtLogo: () => import('../components/Nuxt.svg'),\n    NuxtLogoTwo: () => import('../components/NuxtTwo.svg')\n  }\n}\n</script>\n"
  },
  {
    "path": "test/module.test.js",
    "content": "const consola = require('consola')\nconst getPort = require('get-port')\nconst { Nuxt, Builder } = require('nuxt-edge')\n\njest.setTimeout(60 * 1000)\n\nlet nuxt, port\n\ndescribe('ssr', () => {\n  beforeEach(() => {\n    consola.mockTypes(() => jest.fn())\n  })\n\n  test('emit error when loader can\\'t be registered', async () => {\n    try {\n      await setupNuxt(require('./fixture/configs/error-without-image-loader-rule'))\n    } catch (e) {\n      expect(e.message).toBe('Nuxt Build Error')\n      return\n    }\n    Error('Never reach this state')\n  })\n\n  test('correctly load two lazy-loaded SVGs', async () => {\n    const nuxt = await setupNuxt(require('./fixture/configs/default'))\n    const { html } = await nuxt.renderRoute('/two')\n    expect(html).toMatchSnapshot()\n  })\n\n  test('honor custom build.extend function', async () => {\n    nuxt = await setupNuxt(require('./fixture/configs/with-extend-fn'))\n\n    const messageInExtendFunction = 'Build fn'\n    const consolaMessages = consola.fatal.mock.calls.map(c => c[0])\n    expect(consolaMessages).toContain(messageInExtendFunction)\n\n    const { html } = await nuxt.renderRoute('/')\n    expect(html).toMatchSnapshot()\n  })\n\n  test('honor custom loader options', async () => {\n    nuxt = await setupNuxt(require('./fixture/configs/with-options'))\n\n    const { html } = await nuxt.renderRoute('/')\n    expect(html).toMatchSnapshot()\n  })\n\n  test('correctly load SVG as background image', async () => {\n    const nuxt = await setupNuxt(require('./fixture/configs/default'))\n    const { html } = await nuxt.renderRoute('/background-image')\n    expect(html).toMatchSnapshot()\n  })\n\n  afterEach(async () => {\n    if (nuxt) {\n      await nuxt.close()\n    }\n  })\n})\n\nconst setupNuxt = async (config) => {\n  const nuxt = new Nuxt(config)\n  await new Builder(nuxt).build()\n  port = await getPort()\n  await nuxt.listen(port)\n\n  return nuxt\n}\n"
  }
]