Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False bailout with deep require #19

Open
doochik opened this issue Sep 20, 2017 · 0 comments
Open

False bailout with deep require #19

doochik opened this issue Sep 20, 2017 · 0 comments

Comments

@doochik
Copy link

doochik commented Sep 20, 2017

// root.js
const { foo } = require('./bundle.js');

// bundle.js
module.exports = {
  foo: require('./foo.js'),
  bar: require('./bar.js'),
}

In this case bar is not exported, but required and minifier can't eliminate this code.

Compiled code looks like this

/***/ (function(module, exports, __webpack_require__) {

module.exports = {
    "bar": ((__webpack_require__(4)),null),
    foo: __webpack_require__(5)
};

/***/ }),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant