mirror of https://github.com/webpack/webpack.git
Merge pull request #4625 from smelukov/original-module-source
Add originalSource method to NormalModule
This commit is contained in:
commit
4153b58c53
|
|
@ -456,6 +456,10 @@ class NormalModule extends Module {
|
|||
return new CachedSource(source);
|
||||
}
|
||||
|
||||
originalSource() {
|
||||
return this._source;
|
||||
}
|
||||
|
||||
getHighestTimestamp(keys, timestampsByKey) {
|
||||
let highestTimestamp = 0;
|
||||
for(let i = 0; i < keys.length; i++) {
|
||||
|
|
|
|||
|
|
@ -141,6 +141,16 @@ describe("NormalModule", function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("#originalSource", function() {
|
||||
let expectedSource = "some source";
|
||||
beforeEach(function() {
|
||||
normalModule._source = new RawSource(expectedSource);
|
||||
});
|
||||
it("returns an original Source", function() {
|
||||
normalModule.originalSource().should.eql(normalModule._source);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#updateHashWithSource", function() {
|
||||
let hashSpy;
|
||||
let hash;
|
||||
|
|
|
|||
Loading…
Reference in New Issue