Skip to content

Conversation

@Pauan
Copy link
Contributor

@Pauan Pauan commented Apr 29, 2020

Some bundlers (such as Webpack) will process require even if it's inside of a conditional branch. Since we only want the require to run in Node, we want Webpack to completely ignore it. Using module.require seems to be the best way to do that.

I would really rather just remove the require completely, but NodeJS 10 is supported until 2021-04-01, so we can't remove it until then.

Fixes #2116

@alexcrichton alexcrichton merged commit 7bee6a8 into wasm-bindgen:master Apr 29, 2020
@Pauan Pauan deleted the fixing-require branch April 30, 2020 02:24
@BenoitDel
Copy link

If this PR is included in was-bindgen v0.2.61. The webpack compilation error is still there.

@Pauan
Copy link
Contributor Author

Pauan commented May 1, 2020

@BenoitDel It is not included in 0.2.61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node dependency and webpack 5

3 participants