Socket
Socket
Sign inDemoInstall

tsconfig-paths-webpack-plugin

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsconfig-paths-webpack-plugin - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

11

CHANGELOG.md

@@ -10,2 +10,10 @@ # Change Log

## [3.0.1] - 2018-03-13
### Fixed
* Upgraded tsconfig-paths to 3.1.2 which includes the fix in https://github.com/dividab/tsconfig-paths/pull/29.
* Fix for the new webpack 4 code to prevent callback from firing multiple times, see [#11](https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/11). Thanks to [@Nayni](https://github.com/Nayni) for this fix! (See PR [#12](https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/12)).
## [3.0.0] - 2018-03-13

@@ -96,3 +104,4 @@

[unreleased]: https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.0.0...master
[unreleased]: https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.0.1...master
[3.0.1]: https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/2.0.0...3.0.0

@@ -99,0 +108,0 @@ [2.0.0]: https://github.com/dividab/tsconfig-paths-webpack-plugin/compare/1.4.0...2.0.0

24

lib/plugin.js

@@ -72,3 +72,3 @@ "use strict";

if (err) {
callback(err);
return callback(err);
}

@@ -84,7 +84,12 @@ if (!foundMatch) {

return resolver.doResolve(hook, newRequest, `Resolved request '${innerRequest}' to '${foundMatch}' using tsconfig.json paths mapping`, createInnerContext(Object.assign({}, resolveContext)), (err2, result2) => {
if (arguments.length > 0) {
return callback(err2, result2);
// Pattern taken from:
// https://github.com/webpack/enhanced-resolve/blob/42ff594140582c3f8f86811f95dea7bf6774a1c8/lib/AliasPlugin.js#L44
if (err2) {
return callback(err2);
}
// don't allow other aliasing or raw request
callback(null, null);
// Don't allow other aliasing or raw request
if (result2 === undefined) {
return callback(null, null);
}
callback(null, result2);
});

@@ -105,3 +110,3 @@ });

if (err) {
callback(err);
return callback(err);
}

@@ -116,3 +121,8 @@ if (!foundMatch) {

const createInnerCallback = require("enhanced-resolve/lib/createInnerCallback");
return resolver.doResolve(target, newRequest, `Resolved request '${innerRequest}' to '${foundMatch}' using tsconfig.json paths mapping`, createInnerCallback((err2, result2) => {
return resolver.doResolve(target, newRequest, `Resolved request '${innerRequest}' to '${foundMatch}' using tsconfig.json paths mapping`, createInnerCallback(function (err2, result2) {
// Note:
// *NOT* using an arrow function here because arguments.length implies we have "this"
// That means "this" has to be in the current function scope, and not the scope above.
// Pattern taken from:
// https://github.com/s-panferov/awesome-typescript-loader/blob/10653beff85f555f1f3b5d4bfd7d21513d0e54a4/src/paths-plugin.ts#L169
if (arguments.length > 0) {

@@ -119,0 +129,0 @@ return callback(err2, result2);

{
"name": "tsconfig-paths-webpack-plugin",
"version": "3.0.0",
"version": "3.0.1",
"description": "Load modules according to tsconfig paths in webpack.",

@@ -11,3 +11,3 @@ "main": "index.js",

"chalk": "^2.3.0",
"tsconfig-paths": "^3.1.1"
"tsconfig-paths": "^3.1.2"
},

@@ -14,0 +14,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc