Skip to content

Commit b40cecd

Browse files
committed
Correct source and size behavior
1 parent 0ffb404 commit b40cecd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "appcache-webpack-plugin-plus",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"contributors": [
55
"Eric Eldredge <[email protected]>",
66
"Ian Copp <[email protected]>"

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ export default class AppCachePlugin {
5555
compilation: {
5656
hash: string
5757
chunkhash: string
58-
assets: { [filename: string]: { source: string; size: number } }
58+
assets: {
59+
[filename: string]: { source: () => string; size: () => number }
60+
}
5961
},
6062
callback: () => void
6163
) => {
@@ -101,8 +103,8 @@ export default class AppCachePlugin {
101103
.join('\n')
102104

103105
compilation.assets[this.output] = {
104-
source: finalManifest,
105-
size: Buffer.byteLength(finalManifest)
106+
source: () => finalManifest,
107+
size: () => Buffer.byteLength(finalManifest)
106108
}
107109
callback()
108110
}

0 commit comments

Comments
 (0)