webpack / webpack-sources

Source code handling classes for webpack
MIT License
261 stars 71 forks source link

res.code is generated code and not Source.prototype.source() #105

Closed bugknightyyp closed 3 years ago

bugknightyyp commented 3 years ago

https://github.com/webpack/webpack-sources/blob/9ec78f2ef3d9169293636c48b7741ebb7b457ac6/lib/helpers.js#L23

Documents write:

sourceAndMap
Source.prototype.sourceAndMap(options?: Object) -> {
    source: String | Buffer,
    map: Object | null
}
Returns both, source code (like Source.prototype.source() and SourceMap (like Source.prototype.map()). This method could have better performance than calling source() and map() separately.

See map() for options.

Can you explain it ? thx