<h2 dir="auto">Feature request</h2>
<p dir="auto">When optimization.sideEffects is set to true, the code will not be analyzed for side effects during production mode construction，<br>
The sideEffects field in package.json will still be used<br>
Whether sideEffects in package.json should be ignored when optimization.sideEffects is true and in production mode</p>





<p dir="auto"><strong>What is the expected behavior?</strong><br>
Whether sideEffects in package.json should be ignored when optimization.sideEffects is true and in production mode,<br>
but when production model and optimization.sideEffects:true，Still use package.json's sideEffects</p>
<p dir="auto"><strong>What is motivation or use case for adding/changing the behavior?</strong><br>
<a href="https://github.com/galaxy-s10/issue-demo/blob/master/demo1/webpack.config.js">https://github.com/galaxy-s10/issue-demo/blob/master/demo1/webpack.config.js</a></p>
<p dir="auto"><strong>How should this be implemented in your opinion?</strong></p>
<p dir="auto"><strong>Are you willing to work on this yourself?</strong><br>
emm</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ERROR in   TypeError: __webpack_require__(...) is not a function
  
  
  - index.ejs:1205 Object.../node_modules/webpack/buildin/harmony-module.js
    /home/adam/apps/memory-n-back/web/index.ejs:1205:1
  
  - index.ejs:622 __webpack_require__
    /home/adam/apps/memory-n-back/web/index.ejs:622:30
  
  - index.ejs:46 fn
    /home/adam/apps/memory-n-back/web/index.ejs:46:20
  
  
  - index.ejs:1197 Object.../node_modules/webpack/buildin/global.js
    /home/adam/apps/memory-n-back/web/index.ejs:1197:1
  
  - index.ejs:622 __webpack_require__
    /home/adam/apps/memory-n-back/web/index.ejs:622:30
  
  - index.ejs:46 fn
    /home/adam/apps/memory-n-back/web/index.ejs:46:20
  
  
  - index.ejs:1189 Object.../node_modules/lodash/lodash.js
    /home/adam/apps/memory-n-back/web/index.ejs:1189:1"><pre class="notranslate">ERROR <span class="pl-k">in</span>   TypeError: __webpack_require__(...) is not a function
  
  
  - index.ejs:1205 Object.../node_modules/webpack/buildin/harmony-module.js
    /home/adam/apps/memory-n-back/web/index.ejs:1205:1
  
  - index.ejs:622 __webpack_require__
    /home/adam/apps/memory-n-back/web/index.ejs:622:30
  
  - index.ejs:46 fn
    /home/adam/apps/memory-n-back/web/index.ejs:46:20
  
  
  - index.ejs:1197 Object.../node_modules/webpack/buildin/global.js
    /home/adam/apps/memory-n-back/web/index.ejs:1197:1
  
  - index.ejs:622 __webpack_require__
    /home/adam/apps/memory-n-back/web/index.ejs:622:30
  
  - index.ejs:46 fn
    /home/adam/apps/memory-n-back/web/index.ejs:46:20
  
  
  - index.ejs:1189 Object.../node_modules/lodash/lodash.js
    /home/adam/apps/memory-n-back/web/index.ejs:1189:1</pre></div>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
checking out <a href="https://github.com/goldylucks/memory-n-back/commit/6f0e93247c62b9c005f181abfaf1957eeb017696">this commit</a> from my <a href="https://github.com/goldylucks/memory-n-back">repo</a>  and running <code class="notranslate">npm start</code></p>
<p dir="auto">The thing is I don't know what is causing the crash, because as u can c above, the logs are not very informational, hence I'm opening this issue and not asking on SO</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
Work with tree shaking and not crashing</p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong><br>
OS: <code class="notranslate">ubuntu 16.04</code><br>
webpack:<code class="notranslate"> 2.1.0-beta.25</code><br>
webpack-dev-server: <code class="notranslate">2.1.0-beta.0</code></p>
<p dir="auto">it crashes on both webpack and dev server</p>