Skip to content

Commit 9a37395

Browse files
refactor: code
1 parent 6200614 commit 9a37395

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

.changeset/buffers-all-sources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"webpack-sources": patch
33
---
44

5-
Add explicit `buffers()` implementations to `RawSource`, `OriginalSource`, `PrefixSource`, `ReplaceSource`, and `SourceMapSource`. `ReplaceSource` delegates to the underlying source's `buffers()` when no replacements are queued.
5+
Implements more effective `buffers` and `buffer` for `ReplaceSource` and `buffers` for `PrefixSource`.

lib/ReplaceSource.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ class ReplaceSource extends Source {
193193
*/
194194
buffers() {
195195
if (this._replacements.length === 0) {
196+
// TODO remove in the next major release
196197
return typeof this._source.buffers === "function"
197198
? this._source.buffers()
198199
: [this._source.buffer()];

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
"name": "webpack-sources",
33
"version": "3.4.0",
44
"description": "Source code handling classes for webpack",
5-
"keywords": [
6-
"webpack",
7-
"source-map"
8-
],
5+
"keywords": ["webpack", "source-map"],
96
"homepage": "https://github.com/webpack/webpack-sources#readme",
107
"bugs": {
118
"url": "https://github.com/webpack/webpack-sources/issues"
@@ -18,10 +15,7 @@
1815
"author": "Tobias Koppers @sokra",
1916
"main": "lib/index.js",
2017
"types": "types.d.ts",
21-
"files": [
22-
"lib/",
23-
"types.d.ts"
24-
],
18+
"files": ["lib/", "types.d.ts"],
2519
"scripts": {
2620
"lint": "npm run lint:code && npm run lint:types && npm run lint:types-test && npm run lint:special",
2721
"lint:code": "eslint --cache .",

0 commit comments

Comments
 (0)