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AGpB,CACT,CACF,CAEA,MAAM,WAAa,mBAEnB,WAAW,kBAAoB,iBAE/B,OAAO,QAAU","file":"/npm/react-app-rewire-less-and-css-modules@0.1.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-app-rewire-less-and-css-modules@0.1.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 { getLoader, loaderNameMatches } = require(\"react-app-rewired\");\n\nfunction createRewireLess(lessLoaderOptions = {}) {\n  return function(config, env) {\n    const lessExtension = /\\.less$/;\n    const lessModuleExtension = /\\.module.less$/;\n\n    const fileLoader = getLoader(config.module.rules, rule =>\n      loaderNameMatches(rule, \"file-loader\")\n    );\n    fileLoader.exclude.push(lessExtension);\n\n    const cssRules = getLoader(\n      config.module.rules,\n      rule => String(rule.test) === String(/\\.css$/)\n    );\n\n    let lessRules;\n    let lessRulesModules;\n    if (env === \"production\") {\n      lessRules = {\n        test: lessExtension,\n        exclude: lessModuleExtension,\n        loader: [\n          // TODO: originally this part is wrapper in extract-text-webpack-plugin\n          //       which we cannot do, so some things like relative publicPath\n          //       will not work.\n          //       https://github.com/timarney/react-app-rewired/issues/33\n          ...cssRules.loader,\n          { loader: \"less-loader\", options: lessLoaderOptions }\n        ]\n      };\n      lessRulesModules = {\n        test: lessModuleExtension,\n        loader: [\n          ...cssRules.loader.map(rule => {\n            if (String(rule.loader).includes(\"/css-loader/\")) {\n              return {\n                loader: rule.loader,\n                options: {\n                  minimize: true,\n                  modules: true,\n                  importLoaders: 1,\n                  localIdentName: \"[hash:base64:5]\"\n                }\n              };\n            }\n            return rule;\n          }),\n          {\n            loader: require.resolve(\"less-loader\"),\n            options: lessLoaderOptions\n          }\n        ]\n      };\n    } else {\n      lessRules = {\n        test: lessExtension,\n        exclude: lessModuleExtension,\n        use: [\n          ...cssRules.use,\n          { loader: \"less-loader\", options: lessLoaderOptions }\n        ]\n      };\n      lessRulesModules = {\n        test: lessModuleExtension,\n        use: [\n          ...cssRules.use.map(rule => {\n            if (String(rule.loader).includes(\"/css-loader/\")) {\n              return {\n                loader: rule.loader,\n                options: {\n                  modules: true,\n                  sourceMap: true,\n                  importLoaders: 1,\n                  localIdentName: \"[name]__[local]--[hash:base64:5]\"\n                }\n              };\n            }\n            return rule;\n          }),\n          {\n            loader: require.resolve(\"less-loader\"),\n            options: lessLoaderOptions\n          }\n        ]\n      };\n    }\n\n    const oneOfRule = config.module.rules.find(\n      rule => rule.oneOf !== undefined\n    );\n    if (oneOfRule) {\n      oneOfRule.oneOf.unshift(lessRules);\n      oneOfRule.oneOf.unshift(lessRulesModules);\n    } else {\n      // Fallback to previous behaviour of adding to the end of the rules list.\n      config.module.rules.push(lessRules);\n      config.module.rules.push(lessRulesModules);\n    }\n\n    return config;\n  };\n}\n\nconst rewireLess = createRewireLess();\n\nrewireLess.withLoaderOptions = createRewireLess;\n\nmodule.exports = rewireLess;"]}