question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Webpack] Matcher doesn't ignore code coming from node_modules

See original GitHub issue

The matcher in the plugin doesn’t ignore code coming from node_modules, which can result in strange and unexpected behaviour, for example, my compilation crashed with:

TypeError: __webpack_require__(...) is not a function

Seems like the condition here is flipped:

https://github.com/JoviDeCroock/prefresh/blob/5bbf5b2f9b36e672b79f542e88aa981dc130e066/packages/webpack/src/index.js#L17

Inverting it fixed the issue for me.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JoviDeCroockcommented, Nov 22, 2020

All right publishing, sorry about that!

EDIT: published as 2.2.1

0reactions
SkaceKamencommented, Nov 22, 2020

Thanks for your work! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

ignoring node_modules · Issue #839 · webpack ... - GitHub
That code actually doesn't work. It doesn't take any aliases into account. I only have one alias, but I really don't want to...
Read more >
Webpack not excluding node_modules - Stack Overflow
Add target: 'node' to your webpack.config.js . · Set the externalPresets of node to true . As of Webpack@5, This configuration will exclude...
Read more >
Resolve | webpack
import Test1 from 'xyz'; // Exact match, so path/to/file.js is resolved and ... Setting resolve.alias to false will tell webpack to ignore a...
Read more >
Tree Shaking - webpack
The webpack 2 release came with built-in support for ES2015 modules (alias ... bundle.js |- index.html |- /src |- index.js + |- math.js...
Read more >
Module Methods - webpack
webpackIgnore : Disables dynamic import parsing when set to true . warning. Note that setting webpackIgnore to true opts out of code splitting....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found