The combination of tree shaking and dead code elimination would make this snippet generate a bundle where mobx-react-devtools is not included in production mode.
import DevTools from 'mobx-react-devtools';
console.log("noop");
It is not the case right now since mobx-react-devtools is not declared side effects free.
Ideally mobx-react-devtools would declare that it is side effects free (cf https://stackoverflow.com/a/49203452), if it is the case of course (which I think it is)
I'm using a Webpack 4.
The combination of tree shaking and dead code elimination would make this snippet generate a bundle where
mobx-react-devtools
is not included in production mode.It is not the case right now since
mobx-react-devtools
is not declared side effects free.I managed to work around it using a module rule:
Ideally
mobx-react-devtools
would declare that it is side effects free (cf https://stackoverflow.com/a/49203452), if it is the case of course (which I think it is)