babel-plugin-module-resolver
Advanced tools
Comparing version 3.1.3 to 3.2.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="3.2.0"></a> | ||
# [3.2.0](https://github.com/tleunen/babel-plugin-module-resolver/compare/v3.1.3...v3.2.0) (2019-02-11) | ||
### Features | ||
* **dev:** add loglevel to configure console logging ([#351](https://github.com/tleunen/babel-plugin-module-resolver/issues/351)) ([d4a596c](https://github.com/tleunen/babel-plugin-module-resolver/commit/d4a596c)) | ||
<a name="3.1.3"></a> | ||
@@ -7,0 +17,0 @@ ## [3.1.3](https://github.com/tleunen/babel-plugin-module-resolver/compare/v3.1.2...v3.1.3) (2019-01-21) |
@@ -110,2 +110,6 @@ "use strict"; | ||
function normalizeLoglevel(optsLoglevel) { | ||
return optsLoglevel || 'warn'; | ||
} | ||
var _default = (0, _reselect.createSelector)( // The currentFile should have an extension; otherwise it's considered a special value | ||
@@ -116,2 +120,3 @@ currentFile => currentFile.includes('.') ? _path.default.dirname(currentFile) : currentFile, (_, opts) => opts, (currentFile, opts) => { | ||
const alias = normalizeAlias(opts.alias); | ||
const loglevel = normalizeLoglevel(opts.loglevel); | ||
const transformFunctions = normalizeTransformedFunctions(opts.transformFunctions); | ||
@@ -125,2 +130,3 @@ const extensions = opts.extensions || defaultExtensions; | ||
alias, | ||
loglevel, | ||
transformFunctions, | ||
@@ -127,0 +133,0 @@ extensions, |
@@ -55,6 +55,6 @@ "use strict"; | ||
function checkIfPackageExists(modulePath, currentFile, extensions) { | ||
function checkIfPackageExists(modulePath, currentFile, extensions, loglevel) { | ||
const resolvedPath = (0, _utils.nodeResolvePath)(modulePath, currentFile, extensions); | ||
if (resolvedPath === null) { | ||
if (resolvedPath === null && loglevel !== 'silent') { | ||
(0, _log.warn)(`Could not resolve "${modulePath}" in file ${currentFile}.`); | ||
@@ -86,3 +86,3 @@ } | ||
if (process.env.NODE_ENV !== 'production') { | ||
checkIfPackageExists(aliasedSourceFile, currentFile, opts.extensions); | ||
checkIfPackageExists(aliasedSourceFile, currentFile, opts.extensions, opts.loglevel); | ||
} | ||
@@ -89,0 +89,0 @@ |
{ | ||
"name": "babel-plugin-module-resolver", | ||
"version": "3.1.3", | ||
"version": "3.2.0", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "description": "Module resolver plugin for Babel", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37111
356