{
  "manifest": {
    "name": "babel-loader",
    "version": "8.3.0",
    "description": "babel module loader for webpack",
    "files": [
      "lib"
    ],
    "main": "lib/index.js",
    "engines": {
      "node": ">= 8.9"
    },
    "dependencies": {
      "find-cache-dir": "^3.3.1",
      "loader-utils": "^2.0.0",
      "make-dir": "^3.1.0",
      "schema-utils": "^2.6.5"
    },
    "peerDependencies": {
      "@babel/core": "^7.0.0",
      "webpack": ">=2"
    },
    "devDependencies": {
      "@ava/babel": "^1.0.1",
      "@babel/cli": "^7.19.3",
      "@babel/core": "^7.19.6",
      "@babel/preset-env": "^7.19.4",
      "ava": "^3.13.0",
      "babel-eslint": "^10.0.1",
      "babel-plugin-istanbul": "^6.0.0",
      "babel-plugin-react-intl": "^8.2.15",
      "cross-env": "^7.0.2",
      "eslint": "^7.13.0",
      "eslint-config-babel": "^9.0.0",
      "eslint-config-prettier": "^6.3.0",
      "eslint-plugin-flowtype": "^5.2.0",
      "eslint-plugin-prettier": "^3.0.0",
      "husky": "^4.3.0",
      "lint-staged": "^10.5.1",
      "nyc": "^15.1.0",
      "pnp-webpack-plugin": "^1.6.4",
      "prettier": "^2.1.2",
      "react": "^17.0.1",
      "react-intl": "^5.9.4",
      "react-intl-webpack-plugin": "^0.3.0",
      "rimraf": "^3.0.0",
      "semver": "7.3.2",
      "webpack": "^5.34.0"
    },
    "scripts": {
      "clean": "rimraf lib/",
      "build": "babel src/ --out-dir lib/ --copy-files",
      "format": "prettier --write --trailing-comma all 'src/**/*.js' 'test/**/*.test.js' 'test/helpers/*.js' && prettier --write --trailing-comma es5 'scripts/*.js'",
      "lint": "eslint src test",
      "precommit": "lint-staged",
      "prepublish": "yarn run clean && yarn run build",
      "preversion": "yarn run test",
      "test": "yarn run lint && cross-env BABEL_ENV=test yarn run build && yarn run test-only",
      "test-only": "nyc ava"
    },
    "repository": {
      "type": "git",
      "url": "https://github.com/babel/babel-loader.git"
    },
    "keywords": [
      "webpack",
      "loader",
      "babel",
      "es6",
      "transpiler",
      "module"
    ],
    "author": {
      "name": "Luis Couto",
      "email": "hello@luiscouto.pt"
    },
    "license": "MIT",
    "bugs": {
      "url": "https://github.com/babel/babel-loader/issues"
    },
    "homepage": "https://github.com/babel/babel-loader",
    "nyc": {
      "all": true,
      "include": [
        "src/**/*.js"
      ],
      "reporter": [
        "text",
        "json"
      ],
      "sourceMap": false,
      "instrument": false
    },
    "ava": {
      "files": [
        "test/**/*.test.js",
        "!test/fixtures/**/*",
        "!test/helpers/**/*"
      ],
      "babel": {
        "compileAsTests": [
          "test/helpers/**/*"
        ]
      }
    },
    "lint-staged": {
      "scripts/*.js": [
        "prettier --trailing-comma es5 --write",
        "git add"
      ],
      "src/**/*.js": [
        "prettier --trailing-comma all --write",
        "git add"
      ],
      "test/**/*.test.js": [
        "prettier --trailing-comma all --write",
        "git add"
      ],
      "test/helpers/*.js": [
        "prettier --trailing-comma all --write",
        "git add"
      ],
      "package.json": [
        "node ./scripts/yarn-install.js",
        "git add yarn.lock"
      ]
    },
    "resolutions": {
      "nyc/node-preload": "0.2.0"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-babel-loader-8.3.0-124936e841ba4fe8176786d6ff28add1f134d6a8-integrity/node_modules/babel-loader/package.json",
    "readmeFilename": "README.md",
    "readme": "> This README is for babel-loader v8 + Babel v7\n> If you are using legacy Babel v6, see the [7.x branch](https://github.com/babel/babel-loader/tree/7.x) docs\n\n[![NPM Status](https://img.shields.io/npm/v/babel-loader.svg?style=flat)](https://www.npmjs.com/package/babel-loader)\n[![codecov](https://codecov.io/gh/babel/babel-loader/branch/main/graph/badge.svg)](https://codecov.io/gh/babel/babel-loader)\n\n<div align=\"center\">\n  <a href=\"https://github.com/babel/babel\">\n    <img src=\"https://rawgit.com/babel/logo/master/babel.svg\" alt=\"Babel logo\" width=\"200\" height=\"200\">\n  </a>\n  <a href=\"https://github.com/webpack/webpack\">\n    <img src=\"https://webpack.js.org/assets/icon-square-big.svg\" alt=\"webpack logo\" width=\"200\" height=\"200\">\n  </a>\n</div>\n\n<h1 align=\"center\">Babel Loader</h1>\n\nThis package allows transpiling JavaScript files using [Babel](https://github.com/babel/babel) and [webpack](https://github.com/webpack/webpack).\n\n**Note**: Issues with the output should be reported on the Babel [Issues](https://github.com/babel/babel/issues) tracker.\n\n<h2 align=\"center\">Install</h2>\n\n> webpack `4.x || 5.x` | babel-loader 8.x | babel 7.x\n\n```bash\nnpm install -D babel-loader @babel/core @babel/preset-env webpack\n```\n\n<h2 align=\"center\">Usage</h2>\n\nwebpack documentation: [Loaders](https://webpack.js.org/loaders/)\n\nWithin your webpack configuration object, you'll need to add the babel-loader to the list of modules, like so:\n\n```javascript\nmodule: {\n  rules: [\n    {\n      test: /\\.m?js$/,\n      exclude: /node_modules/,\n      use: {\n        loader: 'babel-loader',\n        options: {\n          presets: [\n            ['@babel/preset-env', { targets: \"defaults\" }]\n          ]\n        }\n      }\n    }\n  ]\n}\n```\n\n### Options\n\nSee the `babel` [options](https://babeljs.io/docs/en/options).\n\nYou can pass options to the loader by using the [`options`](https://webpack.js.org/configuration/module/#ruleoptions--rulequery) property:\n\n```javascript\nmodule: {\n  rules: [\n    {\n      test: /\\.m?js$/,\n      exclude: /node_modules/,\n      use: {\n        loader: 'babel-loader',\n        options: {\n          presets: [\n            ['@babel/preset-env', { targets: \"defaults\" }]\n          ],\n          plugins: ['@babel/plugin-proposal-class-properties']\n        }\n      }\n    }\n  ]\n}\n```\n\nThis loader also supports the following loader-specific option:\n\n* `cacheDirectory`: Default `false`. When set, the given directory will be used to cache the results of the loader. Future webpack builds will attempt to read from the cache to avoid needing to run the potentially expensive Babel recompilation process on each run. If the value is set to `true` in options (`{cacheDirectory: true}`), the loader will use the default cache directory in `node_modules/.cache/babel-loader` or fallback to the default OS temporary file directory if no `node_modules` folder could be found in any root directory.\n\n* `cacheIdentifier`: Default is a string composed by the `@babel/core`'s version, the `babel-loader`'s version, the contents of `.babelrc` file if it exists, and the value of the environment variable `BABEL_ENV` with a fallback to the `NODE_ENV` environment variable. This can be set to a custom value to force cache busting if the identifier changes.\n\n* `cacheCompression`: Default `true`. When set, each Babel transform output will be compressed with Gzip. If you want to opt-out of cache compression, set it to `false` -- your project may benefit from this if it transpiles thousands of files.\n\n* `customize`: Default `null`. The path of a module that exports a `custom` callback [like the one that you'd pass to `.custom()`](#customized-loader). Since you already have to make a new file to use this, it is recommended that you instead use `.custom` to create a wrapper loader. Only use this if you _must_ continue using `babel-loader` directly, but still want to customize.\n\n* `metadataSubscribers`: Default `[]`. Takes an array of context function names. E.g. if you passed ['myMetadataPlugin'], you'd assign a subscriber function to `context.myMetadataPlugin` within your webpack plugin's hooks & that function will be called with `metadata`.\n\n## Troubleshooting\n\n### babel-loader is slow!\n\nMake sure you are transforming as few files as possible. Because you are probably matching `/\\.m?js$/`, you might be transforming the `node_modules` folder or other unwanted source.\n\nTo exclude `node_modules`, see the `exclude` option in the `loaders` config as documented above.\n\nYou can also speed up babel-loader by as much as 2x by using the `cacheDirectory` option. This will cache transformations to the filesystem.\n\n### Some files in my node_modules are not transpiled for IE 11\n\nAlthough we typically recommend not compiling `node_modules`, you may need to when using libraries that do not support IE 11.\n\nFor this, you can either use a combination of `test` and `not`, or [pass a function](https://webpack.js.org/configuration/module/#condition) to your `exclude` option. You can also use negative lookahead regex as suggested [here](https://github.com/webpack/webpack/issues/2031#issuecomment-294706065).\n\n```javascript\n{\n    test: /\\.m?js$/,\n    exclude: {\n      and: [/node_modules/], // Exclude libraries in node_modules ...\n      not: [\n        // Except for a few of them that needs to be transpiled because they use modern syntax\n        /unfetch/,\n        /d3-array|d3-scale/,\n        /@hapi[\\\\/]joi-date/,\n      ]\n    },\n    use: {\n      loader: 'babel-loader',\n      options: {\n        presets: [\n          ['@babel/preset-env', { targets: \"ie 11\" }]\n        ]\n      }\n    }\n  }\n```\n\n### Babel is injecting helpers into each file and bloating my code!\n\nBabel uses very small helpers for common functions such as `_extend`. By default, this will be added to every file that requires it.\n\nYou can instead require the Babel runtime as a separate module to avoid the duplication.\n\nThe following configuration disables automatic per-file runtime injection in Babel, requiring `@babel/plugin-transform-runtime` instead and making all helper references use it.\n\nSee the [docs](https://babeljs.io/docs/plugins/transform-runtime/) for more information.\n\n**NOTE**: You must run `npm install -D @babel/plugin-transform-runtime` to include this in your project and `@babel/runtime` itself as a dependency with `npm install @babel/runtime`.\n\n```javascript\nrules: [\n  // the 'transform-runtime' plugin tells Babel to\n  // require the runtime instead of inlining it.\n  {\n    test: /\\.m?js$/,\n    exclude: /node_modules/,\n    use: {\n      loader: 'babel-loader',\n      options: {\n        presets: [\n          ['@babel/preset-env', { targets: \"defaults\" }]\n        ],\n        plugins: ['@babel/plugin-transform-runtime']\n      }\n    }\n  }\n]\n```\n\n#### **NOTE**: transform-runtime & custom polyfills (e.g. Promise library)\n\nSince [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-runtime) includes a polyfill that includes a custom [regenerator-runtime](https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/runtime.js) and [core-js](https://github.com/zloirock/core-js), the following usual shimming method using `webpack.ProvidePlugin` will not work:\n\n```javascript\n// ...\n        new webpack.ProvidePlugin({\n            'Promise': 'bluebird'\n        }),\n// ...\n```\n\nThe following approach will not work either:\n\n```javascript\nrequire('@babel/runtime/core-js/promise').default = require('bluebird');\n\nvar promise = new Promise;\n```\n\nwhich outputs to (using `runtime`):\n\n```javascript\n'use strict';\n\nvar _Promise = require('@babel/runtime/core-js/promise')['default'];\n\nrequire('@babel/runtime/core-js/promise')['default'] = require('bluebird');\n\nvar promise = new _Promise();\n```\n\nThe previous `Promise` library is referenced and used before it is overridden.\n\nOne approach is to have a \"bootstrap\" step in your application that would first override the default globals before your application:\n\n```javascript\n// bootstrap.js\n\nrequire('@babel/runtime/core-js/promise').default = require('bluebird');\n\n// ...\n\nrequire('./app');\n```\n\n### The Node.js API for `babel` has been moved to `babel-core`.\n\nIf you receive this message, it means that you have the npm package `babel` installed and are using the short notation of the loader in the webpack config (which is not valid anymore as of webpack 2.x):\n```javascript\n  {\n    test: /\\.m?js$/,\n    loader: 'babel',\n  }\n```\n\nwebpack then tries to load the `babel` package instead of the `babel-loader`.\n\nTo fix this, you should uninstall the npm package `babel`, as it is deprecated in Babel v6. (Instead, install `@babel/cli` or `@babel/core`.)\nIn the case one of your dependencies is installing `babel` and you cannot uninstall it yourself, use the complete name of the loader in the webpack config:\n```javascript\n  {\n    test: /\\.m?js$/,\n    loader: 'babel-loader',\n  }\n```\n\n### Exclude libraries that should not be transpiled\n\n`core-js` and `webpack/buildin` will cause errors if they are transpiled by Babel.\n\nYou will need to exclude them form `babel-loader`.\n\n```js\n{\n  \"loader\": \"babel-loader\",\n  \"options\": {\n    \"exclude\": [\n      // \\\\ for Windows, / for macOS and Linux\n      /node_modules[\\\\/]core-js/,\n      /node_modules[\\\\/]webpack[\\\\/]buildin/,\n    ],\n    \"presets\": [\n      \"@babel/preset-env\"\n    ]\n  }\n}\n```\n\n### Top level function (IIFE) is still arrow (on Webpack 5)\n\nThat function is injected by Webpack itself _after_ running `babel-loader`. By default Webpack asumes that your target environment supports some ES2015 features, but you can overwrite this behavior using the `output.environment` Webpack option ([documentation](https://webpack.js.org/configuration/output/#outputenvironment)).\n\nTo avoid the top-level arrow function, you can use `output.environment.arrowFunction`:\n\n```js\n// webpack.config.js\nmodule.exports = {\n  // ...\n  output: {\n    // ...\n    environment: {\n      // ...\n      arrowFunction: false, // <-- this line does the trick\n    },\n  },\n};\n```\n\n## Customize config based on webpack target\n\nWebpack supports bundling multiple [targets](https://webpack.js.org/concepts/targets/). For cases where you may want different Babel configurations for each target (like `web` _and_ `node`), this loader provides a `target` property via Babel's [caller](https://babeljs.io/docs/en/config-files#apicallercb) API.\n\nFor example, to change the environment targets passed to `@babel/preset-env` based on the webpack target:\n\n```javascript\n// babel.config.js\n\nmodule.exports = api => {\n  return {\n    plugins: [\n      \"@babel/plugin-proposal-nullish-coalescing-operator\",\n      \"@babel/plugin-proposal-optional-chaining\"\n    ],\n    presets: [\n      [\n        \"@babel/preset-env\",\n        {\n          useBuiltIns: \"entry\",\n          // caller.target will be the same as the target option from webpack\n          targets: api.caller(caller => caller && caller.target === \"node\")\n            ? { node: \"current\" }\n            : { chrome: \"58\", ie: \"11\" }\n        }\n      ]\n    ]\n  }\n}\n```\n\n## Customized Loader\n\n`babel-loader` exposes a loader-builder utility that allows users to add custom handling\nof Babel's configuration for each file that it processes.\n\n`.custom` accepts a callback that will be called with the loader's instance of\n`babel` so that tooling can ensure that it using exactly the same `@babel/core`\ninstance as the loader itself.\n\nIn cases where you want to customize without actually having a file to call `.custom`, you\nmay also pass the `customize` option with a string pointing at a file that exports\nyour `custom` callback function.\n\n### Example\n\n```js\n// Export from \"./my-custom-loader.js\" or whatever you want.\nmodule.exports = require(\"babel-loader\").custom(babel => {\n  function myPlugin() {\n    return {\n      visitor: {},\n    };\n  }\n\n  return {\n    // Passed the loader options.\n    customOptions({ opt1, opt2, ...loader }) {\n      return {\n        // Pull out any custom options that the loader might have.\n        custom: { opt1, opt2 },\n\n        // Pass the options back with the two custom options removed.\n        loader,\n      };\n    },\n\n    // Passed Babel's 'PartialConfig' object.\n    config(cfg) {\n      if (cfg.hasFilesystemConfig()) {\n        // Use the normal config\n        return cfg.options;\n      }\n\n      return {\n        ...cfg.options,\n        plugins: [\n          ...(cfg.options.plugins || []),\n\n          // Include a custom plugin in the options.\n          myPlugin,\n        ],\n      };\n    },\n\n    result(result) {\n      return {\n        ...result,\n        code: result.code + \"\\n// Generated by some custom loader\",\n      };\n    },\n  };\n});\n```\n\n```js\n// And in your Webpack config\nmodule.exports = {\n  // ..\n  module: {\n    rules: [{\n      // ...\n      loader: path.join(__dirname, 'my-custom-loader.js'),\n      // ...\n    }]\n  }\n};\n```\n\n### `customOptions(options: Object): { custom: Object, loader: Object }`\n\nGiven the loader's options, split custom options out of `babel-loader`'s\noptions.\n\n\n### `config(cfg: PartialConfig): Object`\n\nGiven Babel's `PartialConfig` object, return the `options` object that should\nbe passed to `babel.transform`.\n\n\n### `result(result: Result): Result`\n\nGiven Babel's result object, allow loaders to make additional tweaks to it.\n\n\n## License\n[MIT](https://couto.mit-license.org/)\n",
    "licenseText": "Copyright (c) 2014-2019 Luís Couto <hello@luiscouto.pt>\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.3.0.tgz",
    "hash": "124936e841ba4fe8176786d6ff28add1f134d6a8",
    "integrity": "sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q==",
    "registry": "npm",
    "packageName": "babel-loader",
    "cacheIntegrity": "sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q== sha1-Ekk26EG6T+gXZ4bW/yit0fE01qg="
  },
  "registry": "npm",
  "hash": "124936e841ba4fe8176786d6ff28add1f134d6a8"
}