Failed to parse sourcemap when bundling with webpack
- Dominant language
- TypeScript
- Stars
- 14.7k
- Forks
- 777
- PR merge metrics
- No merged PRs in 30d
Description
# Expected Behavior
Source map can be correctly parsed by bundlers.
# Current Behavior
Webpack@5.95.0 fails to parse source maps, throws the following error:
```
Failed to parse source map from '/path/to/project/node_modules/jimp/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/to/project/node_modules/jimp/src/index.ts'
```
# Failure Information (for bugs)
Jimp only exports the `dist` folder to npm, however the `index.js.map` has a direct reference to the `src/index.ts`, which is not included on npm:
```
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[], ...}
```
the source file loader then tries to parse the `sources` array, but since it's missing, it throws a ENOENT
## Steps to Reproduce
1. import jimp into a file
2. try to bundle with a barebones webpack config
**Screenshots**
## Context
- Jimp Version: 1.6.0
- Operating System: MacOS Ventura 13.3
- Node version: 20.18
## Failure Logs
Contributor guide
Assessment
This issue has not been assessed yet.