aspect-build / aspect-build/rules_webpack
[Bug]: Errors when using builtin webpack plugins
- Dominant language
- Starlark
- Stars
- 33
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
### What happened?
I'm trying to use a built-in webpack plugin, for example:
```js
const { SourceMapDevToolPlugin } = require('webpack');
module.exports = {
devtool: false,
plugins: [new SourceMapDevToolPlugin({})],
}
```
and I get one of two errors depending on whether I include webpack as a dependency in the configuration:
```
[webpack-cli] Error: Cannot find module 'webpack'
```
```
[webpack-cli] TypeError: The 'compilation' argument must be an instance of Compilation
```
### Version
Development (host) and target OS/architectures:
Output of `bazel --version`:
```
bazel 6.0.0
```
Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:
```
rules_webpack v0.7.0
```
### How to reproduce
Full repro workspace here of every variant I tried: https://github.com/titanous/rules_webpack_require_error
### Any other information?
_No response_
### Fund our work
- [ ] Sponsor our open source work by donating a [bug bounty](https://opencollective.com/aspect-build/)
Contributor guide
Assessment
This issue has not been assessed yet.