thread-loader
thread-loader copied to clipboard
fix: getLogger not defined in child loader
This PR fixes #10 and #185.
This PR contains a:
- [x] bugfix
- [ ] new feature
- [ ] code refactor
- [x] test update
- [ ] typo fix
- [ ] metadata update
Motivation / Use-Case
Currently thread-loader is not compatible with less-loader, as outlined in #10 which was closed without resolution.
less-loader calls this.getLogger, which worker.js hadn't defined when calling loaderRunner.runLoaders, so it crashed. I set up getLogger to simply write to the child process's console, instead of messaging back to the parent process - the PoolWorker doesn't currently have access to the parent loader's getLogger function and it seemed like too big of a change to pass it in. I'm open to changing this (but would prefer to get this fix released as soon as possible since it's a live issue.)
Thanks!
Breaking Changes
None
Additional Info
Hello, just following up on this bugfix. This is a live issue affecting any build configurations using thread-loader with less-loader. Thanks!
@alexander-akait Would really appreciate a resolution to this. It's blocking my team from upgrading less-loader.