next.js
ab7744e4 - Respect webpackIgnore and turboIgnore comments in the parser (#68451)

Commit
1 year ago
Respect webpackIgnore and turboIgnore comments in the parser (#68451) ## What This is step one of PACK-3046, setting up the necessary parser-side changes to detect and store the webpackIgnore and turbopackIgnore comment directives. This is followed by another PR that implements the bundler side. ## Why Webpack supports special directives to prevent bundle-time linking of specific imports. Some libraries need this (mapbox) and so we should support it. ## How The directives are stored in comments within `require` and `import` calls. We parse the comments alongside traversal and look for comments that exist inside the function calls. These are then collected and used in later stages when performing linking to opt out of linking packages that have been explicitly excluded.
Author
Parents
Loading