1.7.0 • Published 3 years ago

pnp-webpack-plugin v1.7.0

Weekly downloads
7,040,767
License
MIT
Repository
github
Last release
3 years ago

Plug'n'Play resolver for Webpack

npm version node version

This plugin is also available for Jest (jest-pnp-resolver), Rollup (rollup-plugin-pnp-resolve), and TypeScript (ts-pnp)

Installation

yarn add -D pnp-webpack-plugin

Usage

Simply add the plugin to both the resolver and resolveLoader:

const PnpWebpackPlugin = require(`pnp-webpack-plugin`);

module.exports = {
  resolve: {
    plugins: [
      PnpWebpackPlugin,
    ],
  },
  resolveLoader: {
    plugins: [
      PnpWebpackPlugin.moduleLoader(module),
    ],
  },
};

The resolve entry will take care of correctly resolving the dependencies required by your program, and the resolveLoader entry will help Webpack find the location of the loaders on the disk. Note that in this case, all loaders will be resolved relative to the package containing your configuration.

In case part of your configuration comes from third-party packages that use their own loaders, make sure they use require.resolve - this will ensure that the resolution process is portable accross environments (including when Plug'n'Play isn't enabled), and prevent it from relying on undefined behaviors:

module.exports = {
  module: {
    rules: [{
      test: /\.js$/,
      loader: require.resolve('babel-loader'),
    }]
  },
};

License (MIT)

Copyright © 2016 Maël Nison

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

xmi-scripts@proteria/react-scripts@savaleukhin/react-scripts@scentregroup/react-scripts@procore/core-scripts@talesman/react-scriptscbbpa-clientcc-gram-demoreact-wind-uismart-input-demovuedragdropuploadimagesbyteplayerkstick-react-scriptswatsize-test-react-scripts@psimk/react-scriptsglobal-martcomatch-mvp-debugging@darapti/darapti-react-scriptsswitch_mostqroda-sdkqroda-sdk-v1metaliquid-react-scriptsrockywu-ui@tomas2d/react-scriptsjbojcic-react-scripts@jvhellemondt/custom-react-scripts@st4rfox/electron-scriptssv-component-librarysv-component-library-1sv-component-library-2@straw-hat/neutrino@thuanpq/airvert-ui@xinyifly/react-scripts@ipavinthan/react-scriptsmio-cli-service@katalabut/react-scriptsandculturecode-react-scriptswebeetle-react-scriptsyadong-react@agney/react-scripts-tailwindzackmoreplay-react-scriptsgooapps-react-opsthefarm-react-scripts@wywk/headquaters-marketing-eventconcord-ui-plugin-react-scriptssebrae-boilerplatesebrae-react-scripts@cloudhuset/zd-app-react-scriptsidelic-react-scriptstest-app-6test-app-7tm-components-test@jvhellemondt/react-scriptsearthling-interactive-react-scriptsaerolito-nexthoogo-niuyapingreact-epic-image-sliderpejann-scriptsmy-custom-react-jwplayerinversify-react-scriptselectron-cra-scriptsecom-catalogjs-advancedplatinion-paris-react-componentsreact-scripts-public-urlzula-bravosmartinput-reactstar-react-scripts@amajola/react-scripts@priyanknamdeo16/react-scripts@ashversache/toasterreactor-scripts-for-laravelorbit-shared-components@packages-pragma/react-appreact-cleanupreact-components-common-libraryprinter-editorwasm-worker-react-scriptsoptym-react-scripts@viren.ratan/react-scripts-jsscrazymagi-react-scriptsreact-monorepo-react-scriptsjob-search-web@brielov/react-scriptsdigitalocean-react-scriptsplan8studios-react-scriptswatsize-react-scriptssfg-react-scriptssockam-react-scriptsxxx-examplexianzhengquan-react-scriptsnimajnebp-react-app-templatenimajnebp-react-scripts@react-md/react-scriptssimple-react-image-browserezbobreact-app-no-enforcesoupe-react-scriptsreact-pipviewer@ochrstn/react-scripts
1.7.0

3 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

5 years ago

1.4.3

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.0

6 years ago