FormidableLabs / inspectpack

An inspection tool for Webpack frontend JavaScript bundles.
MIT License
592 stars 20 forks source link

BUG: `multi DOCUMENT_PATH` not inferred correctly. #89

Open ryan-roemer opened 5 years ago

ryan-roemer commented 5 years ago

If we produce up with a bundle like:

/***/ 61:
/*!*******************************************************************************!*\
  !*** multi /PATH/TO/my-app/node_modules/next/dist/pages/_document.js ***!
  \*******************************************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! /PATH/TO/my-app/node_modules/next/dist/pages/_document.js */62);

/***/ }),

/***/ 62:
/*!*************************************************************************!*\
  !*** /PATH/TO/my-app/node_modules/next/dist/pages/_document.js ***!
  \*************************************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! next/document */ 63)

We get the plugin report of:

## static/HASH/pages/_document.js
next (Found 1 resolved, 1 installed. Latest version 7.0.0.)
  7.0.0
    ~/next
      * Dependency graph
        my-app@0.0.1 -> next@^7.0.0
      * Duplicated files in static/HASH/pages/_document.js
        next/dist/pages/_document.js (S, 42)

The issue: This is because the different sources:

both resolve to a short name of next/dist/pages/_document.js

Task

ryan-roemer commented 5 years ago

Note: this may have been fixed / affected by: https://github.com/FormidableLabs/inspectpack/pull/107/files#diff-541cbeb9ca8eec86e3e65baa21d78144R70

Reassess the current issues before jumping in to this ticket...

ryan-roemer commented 5 years ago

It also needs to be re-assessed if fullPath #106 actually ships.