developit/workerize-loader

Fails when a depedency (module) requires a webpack "external" module

Open

#22 建立於 2018年2月14日

在 GitHub 查看
 (3 留言) (4 反應) (0 負責人)JavaScript (111 fork)batch import
help wantedquestion

倉庫指標

Star
 (2,296 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Awesome library! I've just found an edge case when workerizing a module that depends on a webpack external.

In my webpack config i have:

module.exports = {
  // ...
  externals: {
    'config': JSON.stringify(config),
  },
  // ...
}

and in my worker module I have:

import * as config from 'config';

I'm using typescript in case that matters.

Here's the compilation error from webpack:

Module not found: Error: Can't resolve 'config' in '/directory/src'
 @ ./src/MyWorker.ts 1:0-33

貢獻者指南