• Stars
    star
    259
  • Rank 157,669 (Top 4 %)
  • Language
    JavaScript
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Transparently adds support for Plug'n'Play to Webpack

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.

More Repositories

1

clipanion

Type-safe CLI library / framework with no runtime dependencies
TypeScript
882
star
2

virtjs

JS collection of standardized devices, useful for emulating engines
JavaScript
213
star
3

typanion

Static and runtime type assertion library with no dependencies
TypeScript
208
star
4

secretsanta

Host secret santa without leaking your guests' informations 🎄
HTML
190
star
5

colibrijs

Color extractor
JavaScript
150
star
6

sherlock

GitHub Actions toolkit to monitor a repository and run testcases
TypeScript
125
star
7

ts-pnp

Transparently adds support for Plug'n'Play to TypeScript
JavaScript
65
star
8

cpp-loader

A C++ loader for Webpack
C++
58
star
9

sparkle

WebGL particle engine
JavaScript
49
star
10

graphql-typescript-integration

TypeScript
35
star
11

eslint-plugin-arca

Various ESLint rules tailored to the author's preferred style
TypeScript
33
star
12

mono-layout

Fast implementation of a browser-like text layout engine, for Node and browsers
C++
27
star
13

pokelib

A library allowing to control & change the runtime values of a Pokemon game
JavaScript
26
star
14

pxeger

Reverse regular expression engine - generate all possible values for a regular expression
JavaScript
25
star
15

jest-pnp-resolver

Transparently adds support for Plug'n'Play to Jest
JavaScript
24
star
16

pnp-rust

JavaScript
23
star
17

ohui

Javascript curses library
JavaScript
22
star
18

rollup-plugin-pnp-resolve

Transparently adds support for Plug'n'Play to Rollup
JavaScript
19
star
19

node-sea

Pack entire packages and application into portable scripts
TypeScript
18
star
20

emmagic

Easily transport your data structures between your C++ and Javascript
C++
16
star
21

trivia.ff9

Extraction & conversion tools for Final Fantasy IX
C++
16
star
22

js.voxel

[DEPRECATED, cf readme for an alternative] Javascript voxel engine
JavaScript
15
star
23

peg.arcanis.fr

PEG.js web editor
JavaScript
14
star
24

gist-proxy-server

JavaScript
14
star
25

datefuzz

jQuery plugin for simple fuzzy date management
CSS
12
star
26

magicbin

Simple process manager; alternative to pm2
TypeScript
12
star
27

mpllvm

Metaprogramming type resolver for LLVM
C++
11
star
28

js.perlin

Javascript perlin's noise implementation - Demo on the arcanis/voxplode repository
JavaScript
9
star
29

pikasprite

A set of pokemon icons
CSS
8
star
30

voxplode

HTML5 game powered by the SWAT framework
JavaScript
8
star
31

babel-plugin-lazy-import

JavaScript
7
star
32

git-smart-project

Collection of smarter Git utilities
TypeScript
7
star
33

pokequery

Prolog library for issuing complex query on the Pokemon databases
JavaScript
6
star
34

RTWorldReader

Javascript library for importing .rtw files into webgl applications
JavaScript
6
star
35

astar-wasm

JavaScript
5
star
36

node-webpack

Isomorphic module loading via Webpack
JavaScript
5
star
37

boost.log

C++
5
star
38

embin

Shell
4
star
39

slice-ansi

JavaScript
4
star
40

arcanis

4
star
41

trivia.gol404

JavaScript
4
star
42

chenille

Keep master green at all times
JavaScript
3
star
43

epitech.pfa

JavaScript
3
star
44

build-pnm

Generate package-name-maps files by consuming the PnP API
JavaScript
3
star
45

tsc-with-workspaces

TypeScript
2
star
46

willikins

JavaScript
2
star
47

is-pnp

Detects whether PnP is enabled or not when running your scripts
JavaScript
2
star
48

tppserver

JavaScript
2
star
49

fe13-planificator

A planificator for Fire Emblem Awakening
JavaScript
2
star
50

arcanis.github.io

HTML
2
star
51

react-tailwind-select

TypeScript
2
star
52

epitech.generic-linked-list

A generic linked list. With bits of preprocessing metaprogrammation.
C
2
star
53

require-context-node

JavaScript
2
star
54

node-tput

tput for node.js
C++
1
star
55

multisweeper

Multiplayer minesweeper
CSS
1
star
56

term-capture

Capture your terminal as HTML
Python
1
star
57

presentation.jsmontreal-20130312

JavaScript
1
star
58

js.spark

Yet another javascript particle engine
JavaScript
1
star
59

tco

C++
1
star
60

ghost-theme

My own ghost theme
CSS
1
star
61

nitro

Advanced HTML5 mobile development framework, for Angular aficionados
JavaScript
1
star
62

arca-rs

Just a couple of Rust utilities I use
Rust
1
star
63

jest-coverage-ts

TypeScript
1
star
64

rollup-node-resolve-regression

JavaScript
1
star
65

tinylogic

JavaScript
1
star
66

webpack-project-generator

JavaScript
1
star
67

esfuse

TypeScript
1
star
68

ts-monorepo-example

JavaScript
1
star