title: Is there any way to preserve directory structure of bundles when using rollup with code splitting?
body: <h1>Context:</h1>
  
  <p>Given a project structure like this:</p>
  
  <pre><code>┌ src
  ├─┬ a
  │ └── module.js
  ├─┬ b
  │ └── module.js
  └── util.js
  </code></pre>
  
  <p>Where both <code>module.js</code> files import <code>util.js</code>, using the following configuration:</p>
  
  <pre><code>export default {
      experimentalCodeSplitting: true,
      input: [
          'src/a/module.js',
          'src/b/module.js'
      ],
      output: {
          dir: 'bundle',
          format: 'esm'
      }
  };
  </code></pre>
  
  <p>The following structure is output:</p>
  
  <pre><code>┌ bundle
  ├── chunk-af6d88c4.js
  ├── module.js
  └── module2.js
  </code></pre>
  
  <h1>Problem:</h1>
  
  <p>When using code splitting to reduce redundant code across a project, if there are multiple modules with the same file name in different directories, when rollup writes to the output directory it creates a flat structure. It is smart enough to recognize that multiple files have the same name, and appends a number to differentiate them. While this is working code, it becomes difficult to maintain references to those modules on the pages that require them - the developer has to know which number corresponds to which file.</p>
  
  <p>Is there any way to get rollup to preserve the folder structure when outputting multiple bundles, to show file relationships more clearly? Or if this is not possible through rollup alone, is there another solution that can be taken?</p>