Socket
Socket
Sign inDemoInstall

pnp-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pnp-webpack-plugin - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

16

index.js

@@ -71,2 +71,7 @@ const path = require(`path`);

resolver.getHook(`after-module`).tapAsync(`PnpResolver`, (request, resolveContext, callback) => {
// rethrow pnp errors if we have any for this request
return callback(resolveContext.pnpErrors && resolveContext.pnpErrors.get(request.context.issuer));
});
// Register a plugin that will resolve bare imports into the package location on the filesystem before leaving the rest of the resolution to Webpack

@@ -98,3 +103,12 @@ resolver.getHook(`before-module`).tapAsync(`PnpResolver`, (requestContext, resolveContext, callback) => {

} catch (error) {
return callback(error);
if (resolveContext.missingDependencies)
resolveContext.missingDependencies.add(requestContext.path);
if (resolveContext.log)
resolveContext.log(error.message);
resolveContext.pnpErrors = resolveContext.pnpErrors || new Map();
resolveContext.pnpErrors.set(issuer, error);
return callback();
}

@@ -101,0 +115,0 @@

2

package.json
{
"name": "pnp-webpack-plugin",
"version": "1.5.0",
"version": "1.6.0",
"description": "plug'n'play resolver for Webpack",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -50,41 +50,2 @@ # <img src="https://raw.githubusercontent.com/webpack/media/master/logo/icon-square-small.png" height="40" align="right" /> [Plug'n'Play](https://github.com/yarnpkg/rfcs/pull/101) resolver for Webpack

### `ts-loader` integration
This plugin as an integration to easily add support for TypeScript in your applications through `ts-loader`. In order to do this, just do the following:
```js
const PnpWebpackPlugin = require(`pnp-webpack-plugin`);
module.exports = {
module: {
rules: [{
test: /\.ts$/,
loader: require.resolve('ts-loader'),
options: PnpWebpackPlugin.tsLoaderOptions({
// ... regular options go there ...
}),
}],
},
};
```
If you have any options you want to pass to `ts-loader`, just pass them as parameter of the `tsLoaderOptions` function and it will take care of forwarding them properly.
## `fork-ts-checker-webpack-plugin` integration
We also provide an integration for `fork-ts-checker-webpack-plugin`, in a similar way to what we do with `ts-loader`. Here's an example:
```js
const ForkTsCheckerWebpackPlugin = require(`fork-ts-checker-webpack-plugin`);
const PnpWebpackPlugin = require(`pnp-webpack-plugin`);
module.exports = {
plugins: [
new ForkTsCheckerWebpackPlugin(PnpWebpackPlugin.forkTsCheckerOptions({
// ... regular options go there ...
}),
],
};
```
## License (MIT)

@@ -91,0 +52,0 @@

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