<p dir="auto">Hey Sokra,</p>
<p dir="auto">This is my first webpack plugin and contribution to the open source community.</p>
<p dir="auto">The issue that I was faced with is that we have multiple projects and even some runtime loadable code and many developers. Some parts of one project may run standalone or is loaded by another project.</p>
<p dir="auto">The idea is that we'd like to have separate webpack and some non-webpack projects but be able to share code in memory without duplicating it.</p>
<p dir="auto">To do this I created a plugin that:</p>
<ol dir="auto">
<li>Uses the request as the module id instead of an integer so require("jquery") because <strong>_webpack_require</strong>("jquery")</li>
<li>Causes the bootloader to construct and use internal and a global table for installed modules. it checks the internal table first then the global table then constructs the module and puts it in the global table.</li>
<li>Allows modules that are defined as external to be require()'d without throwing a build error</li>
<li>Skips rendering modules that are defined as external</li>
</ol>
<p dir="auto">Now using this plugin I can successfully have loadable code that assumes its dependencies have already been loaded.</p>
<p dir="auto">There are many more features that I'd like to add to it such as being able to wait until' a dependency is loaded and etc...</p>
<p dir="auto">I'd like to get your opinion on this plugin. it is located at:<br>
<a href="https://github.com/EliteScientist/SharedRequirePlugin">https://github.com/EliteScientist/SharedRequirePlugin</a></p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">Report a bug.</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">Duplicate entries are added to records when RuleSet <code class="notranslate">ref--</code> values are needed and the order of loader config changes. This causes the records file to balloon over time.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Please see <a href="https://github.com/rowanoulton/webpack-records-ruleset-ref-bug">https://github.com/rowanoulton/webpack-records-ruleset-ref-bug</a> for an example.</p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Duplicate entries should not occur. Perhaps RecordIdsPlugin should strip <code class="notranslate">ref--</code> values from the loader request to prevent this.</p>
<p dir="auto">Reproduced on webpack 3.4 and 3.10.0.</p>