1

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:

  1. Bundle the src directory by running node src/index.js
  2. Bundle the src directory again by running node dist/index.js

The goal is to be able to run step 2 over and over again.

juliomalves
  • 42,130
  • 20
  • 150
  • 146
woodpav
  • 1,917
  • 2
  • 13
  • 26

1 Answers1

3

swc-loader is not included in the core lib and needs to be installed via package manager - yarn install --dev swc-loader

Yashank
  • 743
  • 2
  • 7
  • 23