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B,EAAK,GACrC,EAAU,aAAa,GACvB,EAAI,cAAa,GAAU,MAAM,EAAQ,IAC3C","file":"/npm/vue-cli-plugin-svg@0.2.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/vue-cli-plugin-svg@0.2.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const _ = require(\"lodash\");\n\n/**\n * The default options for the package. These are defined and configured properly\n * in the vue.config.js file under \"pluginOptions.svg\".\n * @type {Object}\n */\nconst defaults = {\n  inline: { resourceQuery: /inline/, svgo: false }, // Options for vue-svg-loader\n  sprite: { resourceQuery: /sprite/, extract: false }, // Options for svg-sprite-loader\n  data: { resourceQuery: /data/ }, // Options for url-loader\n  external: {} // Options for file-loader\n};\n\n/**\n * The main entry point for the module.\n * @param  {PluginAPI} api     An instance of the PluginAPI\n * @param  {Object}    options All options specified in vue.config.js\n */\nmodule.exports = function handler(api, options) {\n  options = parseOptions(options);\n  api.chainWebpack(config => setup(config, options));\n};\n\n/**\n * Perform the main setup of the svg rule parsing and rewriting. This uses the\n * chainWebpack API modify the required rules.\n * @param  {ChainWebpack} config  An instance of ChainWebpack\n * @param  {Object}       options The svg options from the vue.config.js\n */\nfunction setup(config, options) {\n  const rule = config.module.rule(\"svg\"); // Find the svg rule\n\n  /*\n   * Let's use the file loader option defaults for the svg loader again. Otherwise\n   * we'll have to set our own and it's no longer consistent with the changing\n   * vue-cli.\n   */\n  const fileLoaderOptions = rule.use(\"file-loader\").get(\"options\"); // Get the file loader options\n  options.external = _.merge(fileLoaderOptions, options.external); // Make sure we save the file loader options\n\n  // Use file loader options for sprite name\n  options.sprite = _.merge(\n    { spriteFilename: fileLoaderOptions.name },\n    options.sprite\n  );\n\n  rule.uses.clear(); // Clear out existing uses of the svg rule\n  const query = parseResourceQuery(options); // Get the resource queries\n\n  rule\n    .oneOf(\"inline\")\n    .resourceQuery(query.inline)\n    .use('vue-loader')\n    .loader('vue-loader-v16')\n    .end()\n    .use(\"vue-svg-loader\")\n    .loader(\"vue-svg-loader\")\n    .options(options.inline);\n\n  rule\n    .oneOf(\"sprite\")\n    .resourceQuery(query.sprite)\n    .use(\"svg-sprite-loader\")\n    .loader(\"svg-sprite-loader\")\n    .options(options.sprite);\n\n  rule\n    .oneOf(\"data\")\n    .resourceQuery(query.data)\n    .use(\"url-loader\")\n    .loader(\"url-loader\")\n    .options(options.data);\n\n  rule\n    .oneOf(\"external\")\n    .use(\"file-loader\")\n    .loader(\"file-loader\")\n    .options(options.external);\n}\n\nfunction parseOptions({ pluginOptions = {} }) {\n  let { svg } = pluginOptions; // Get the svg configuration\n\n  // Merge svg options if object, otherwise just use defaults\n  if (typeof svg === \"object\") svg = _.merge(defaults, svg);\n  else if (!svg) svg = defaults;\n  else {\n    throw new TypeError(\n      `pluginOptions.svg is of type \"${typeof svg}\", which is not a valid configuration type`\n    );\n  }\n\n  return svg;\n}\n\n/**\n * Processes the options object passed to the app by extracting the resource query\n * options and returning them so that they can be used later.\n * @param  {object} options The plugin options object\n * @return {object}         An object containing the resource queries and their relevant config names\n */\nfunction parseResourceQuery(options) {\n  const query = {};\n\n  for (option in options) {\n    if (!options[option].resourceQuery) continue; // Skip if no query\n    query[option] = options[option].resourceQuery; // Get the query\n    delete options[option].resourceQuery; // Delete the field (to prevent passing it as a loader option)\n  }\n\n  return query;\n}\n"]}