babel-loader
Advanced tools
Comparing version 9.1.2 to 9.1.3
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
/** | ||
@@ -16,3 +14,2 @@ * Filesystem Cache | ||
const crypto = require("crypto"); | ||
const findCacheDir = require("find-cache-dir"); | ||
const { | ||
@@ -26,2 +23,3 @@ promisify | ||
} = require("fs/promises"); | ||
const findCacheDirP = import("find-cache-dir"); | ||
const transform = require("./transform"); | ||
@@ -172,2 +170,5 @@ // Lazily instantiated when needed | ||
if (defaultCacheDirectory === null) { | ||
const { | ||
default: findCacheDir | ||
} = await findCacheDirP; | ||
defaultCacheDirectory = findCacheDir({ | ||
@@ -174,0 +175,0 @@ name: "babel-loader" |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
const STRIP_FILENAME_RE = /^[^:]+: /; | ||
@@ -4,0 +2,0 @@ const format = err => { |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
let babel; | ||
@@ -4,0 +2,0 @@ try { |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
const babel = require("@babel/core"); | ||
@@ -4,0 +2,0 @@ module.exports = function injectCaller(opts, target) { |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
const babel = require("@babel/core"); | ||
@@ -4,0 +2,0 @@ const { |
{ | ||
"name": "babel-loader", | ||
"version": "9.1.2", | ||
"version": "9.1.3", | ||
"description": "babel module loader for webpack", | ||
@@ -13,3 +13,3 @@ "files": [ | ||
"dependencies": { | ||
"find-cache-dir": "^3.3.2", | ||
"find-cache-dir": "^4.0.0", | ||
"schema-utils": "^4.0.0" | ||
@@ -45,3 +45,3 @@ }, | ||
"rimraf": "^3.0.0", | ||
"semver": "7.3.2", | ||
"semver": "7.5.2", | ||
"webpack": "^5.74.0" | ||
@@ -48,0 +48,0 @@ }, |
@@ -44,3 +44,3 @@ > This README is for babel-loader v8/v9 with Babel v7 | ||
{ | ||
test: /\.m?js$/, | ||
test: /\.(?:js|mjs|cjs)$/, | ||
exclude: /node_modules/, | ||
@@ -70,3 +70,3 @@ use: { | ||
{ | ||
test: /\.m?js$/, | ||
test: /\.(?:js|mjs|cjs)$/, | ||
exclude: /node_modules/, | ||
@@ -111,3 +111,3 @@ use: { | ||
Although we typically recommend not compiling `node_modules`, you may need to when using libraries that do not support IE 11. | ||
Although we typically recommend not compiling `node_modules`, you may need to when using libraries that do not support IE 11 or any legacy targets. | ||
@@ -118,3 +118,3 @@ For 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). | ||
{ | ||
test: /\.m?js$/, | ||
test: /\.(?:js|mjs|cjs)$/, | ||
exclude: { | ||
@@ -157,3 +157,3 @@ and: [/node_modules/], // Exclude libraries in node_modules ... | ||
{ | ||
test: /\.m?js$/, | ||
test: /\.(?:js|mjs|cjs)$/, | ||
exclude: /node_modules/, | ||
@@ -224,3 +224,3 @@ use: { | ||
{ | ||
test: /\.m?js$/, | ||
test: /\.(?:js|mjs|cjs)$/, | ||
loader: 'babel', | ||
@@ -236,3 +236,3 @@ } | ||
{ | ||
test: /\.m?js$/, | ||
test: /\.(?:js|mjs|cjs)$/, | ||
loader: 'babel-loader', | ||
@@ -333,3 +333,4 @@ } | ||
module.exports = require("babel-loader").custom(babel => { | ||
function myPlugin() { | ||
// Extract the custom options in the custom plugin | ||
function myPlugin(api, { opt1, opt2 }) { | ||
return { | ||
@@ -353,3 +354,3 @@ visitor: {}, | ||
// Passed Babel's 'PartialConfig' object. | ||
config(cfg) { | ||
config(cfg, { customOptions }) { | ||
if (cfg.hasFilesystemConfig()) { | ||
@@ -365,4 +366,4 @@ // Use the normal config | ||
// Include a custom plugin in the options. | ||
myPlugin, | ||
// Include a custom plugin in the options and passing it the customOptions object. | ||
[myPlugin, customOptions], | ||
], | ||
@@ -402,3 +403,3 @@ }; | ||
### `config(cfg: PartialConfig): Object` | ||
### `config(cfg: PartialConfig, options: { source, customOptions }): Object` | ||
@@ -405,0 +406,0 @@ Given Babel's `PartialConfig` object, return the `options` object that should |
38387
406
477
+ Addedcaniuse-lite@1.0.30001613(transitive)
+ Addedcommon-path-prefix@3.0.0(transitive)
+ Addedfind-cache-dir@4.0.0(transitive)
+ Addedfind-up@6.3.0(transitive)
+ Addedlocate-path@7.2.0(transitive)
+ Addedp-limit@4.0.0(transitive)
+ Addedp-locate@6.0.0(transitive)
+ Addedpath-exists@5.0.0(transitive)
+ Addedpkg-dir@7.0.0(transitive)
+ Addedyocto-queue@1.0.0(transitive)
- Removedcaniuse-lite@1.0.30001614(transitive)
- Removedcommondir@1.0.1(transitive)
- Removedfind-cache-dir@3.3.2(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removedmake-dir@3.1.0(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpath-exists@4.0.0(transitive)
- Removedpkg-dir@4.2.0(transitive)
Updatedfind-cache-dir@^4.0.0