make original source in CachedSource lazy
This commit is contained in:
parent
0989edb8dd
commit
a4a5a76703
|
@ -328,9 +328,11 @@ declare module "webpack-sources" {
|
|||
}
|
||||
|
||||
export class CachedSource extends Source {
|
||||
constructor(source: Source, cachedData?: any);
|
||||
constructor(source: Source);
|
||||
constructor(source: Source | (() => Source), cachedData?: any);
|
||||
|
||||
original(): Source;
|
||||
originalLazy(): Source | (() => Source);
|
||||
getCachedData(): any;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,8 +38,12 @@ register(
|
|||
* @param {ObjectSerializerContext} context context
|
||||
* @returns {void}
|
||||
*/
|
||||
serialize(source, { write }) {
|
||||
write(source.original());
|
||||
serialize(source, { write, writeLazy }) {
|
||||
if (source.originalLazy) {
|
||||
writeLazy(source.originalLazy());
|
||||
} else {
|
||||
write(source.original());
|
||||
}
|
||||
write(source.getCachedData());
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"tapable": "^2.0.0-beta.11",
|
||||
"terser-webpack-plugin": "^4.1.0",
|
||||
"watchpack": "2.0.0-beta.14",
|
||||
"webpack-sources": "2.0.0-beta.9"
|
||||
"webpack-sources": "2.0.0-beta.10"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"webpack-cli": {
|
||||
|
|
|
@ -554,8 +554,10 @@ declare interface CacheGroupsContext {
|
|||
type CacheOptions = boolean | MemoryCacheOptions | FileCacheOptions;
|
||||
type CacheOptionsNormalized = false | MemoryCacheOptions | FileCacheOptions;
|
||||
declare class CachedSource extends Source {
|
||||
constructor(source: Source, cachedData?: any);
|
||||
constructor(source: Source);
|
||||
constructor(source: Source | (() => Source), cachedData?: any);
|
||||
original(): Source;
|
||||
originalLazy(): Source | (() => Source);
|
||||
getCachedData(): any;
|
||||
}
|
||||
type CallExpression = SimpleCallExpression | NewExpression;
|
||||
|
|
|
@ -6724,10 +6724,10 @@ webidl-conversions@^4.0.2:
|
|||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
|
||||
integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==
|
||||
|
||||
webpack-sources@2.0.0-beta.9:
|
||||
version "2.0.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.0.0-beta.9.tgz#49a504a08c0a8b1c5418c1fdca4ced06b5cb9119"
|
||||
integrity sha512-q6O+gKGojLye0Fm05vgthtmx5LPbYpAU4FsdMsX8YBgkOZovDbQmBMhjY/CiWhxD9u/0AWeWdXFNbQz17mkdLw==
|
||||
webpack-sources@2.0.0-beta.10:
|
||||
version "2.0.0-beta.10"
|
||||
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.0.0-beta.10.tgz#f603355c5518141976601bfd620a3a5a01ac7b5d"
|
||||
integrity sha512-HxeYa9Q6nMk3MtSbi5mKUUV+gOxYlGQwujKbeK0JQ+SmLSMgC4cQkZ+xpsWvsUtTvskDwpKvuVLpE9eW7vn0IQ==
|
||||
dependencies:
|
||||
source-list-map "^2.0.1"
|
||||
source-map "^0.6.1"
|
||||
|
|
Loading…
Reference in New Issue