Tobias Koppers

Results 178 comments of Tobias Koppers

That's a webpack thing, but we don't support that (yet). And probably won't support it in near future. It's only working if each piece is in an separate file and...

At which line does the error happen?

hmm... I see. Try `target: "node"` or `output.globalObject: "xxx"`

Maybe that's the better solution: #6525

We had to switch to `this` to something else, because `this` is `undefined` with ``

Something like that could be solved in a custom resolver plugin. I think think this typescript-specific problem fits into the webpack core. The resolver plugin could take an `extensions` argument...

It could be indeed a bug. Sounds like the bundle becomes strict mode only and `this` is undefined in strict mode. As workaround avoid this as global object. Using the...

`this` in modules (e. g. CommonJs or ESM) is not the same as `this` in a script. `this.onmessage = console.log;` this is equal to `exports.onmessage = console.log;` in CommonJs or...

You could try `new ProvidePlugin({ this: "global" })` maybe that works are workaround. But it affects all modules... Otherwise you can write your code as: ``` js const asset =...

It should use `import.meta.url`. Maybe you forgot to set the script type to `module` in webpack config, as you are using script tags with `type="module"`?