I am working on a Webpack tool that can build itself. I am able to build the tool the first time but when I try to rebuild it a second time I get the error Cannot find module: swc-loader
. The same issue exists when swapping swc-loader
with babel-loader
. My hunch is that this is related to webpack's resolveLoader
Here is a GitHub repository containing the tool.
Below are the steps to reproduce the issue:
- Bundle the
src
directory by runningnode src/index.js
- Bundle the
src
directory again by runningnode dist/index.js
The goal is to be able to run step 2 over and over again.