title: How to "compile" a module?
body: <p>I don't know exactly how to phrase this question so I will do it with an example. (Feel free to edit the question title to something more appropriate)</p>
  
  <p>Consider the following example:</p>
  
  <pre class="lang-js prettyprint-override"><code>    import foo from 'foo'
      import bar from 'bar'
  
      import DATA from './data.json'
  
      const MY_DATA = foo.process(DATA).filter(bar.isBar)
  
      export default class {
          get data() {
              return MY_DATA
          }
  
          propA = true
  
          methodB() {
              // ...
          }
      }
  </code></pre>
  
  <p>Is it possible import this module having <strong>only this class (and the content of <code>MY_DATA</code>)</strong> bundled by Webpack? That is, somehow explicit that I don't want to include 'foo', 'bar' nor './data.json' in this chunk.</p>
  
  <p>Back in the day I would do it using the ignore plugin, but I'm not sure if that still the only option for Webpack 4 since ignoring a module during the whole build isn't always the desirable effect.</p>
  
  <p>Thanks for any hints!</p>