File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @rocket/cli ' : patch
3
+ ' @rocket/eleventy-rocket-nav ' : patch
4
+ ---
5
+
6
+ Improve performance by initializing sax-wasm only once even when it is running in parallel
Original file line number Diff line number Diff line change @@ -243,9 +243,9 @@ async function insertResponsiveImages(html) {
243
243
const config = getComputedConfig ( ) ;
244
244
245
245
if ( ! isSetup ) {
246
- await parser . prepareWasm ( saxWasmBuffer ) ;
247
- isSetup = true ;
246
+ isSetup = parser . prepareWasm ( saxWasmBuffer ) ;
248
247
}
248
+ await isSetup ;
249
249
250
250
const options = {
251
251
inputPath : this . inputPath ,
Original file line number Diff line number Diff line change @@ -97,16 +97,17 @@ function getHeadingsOfHtml(html) {
97
97
return { headings, insertPoint } ;
98
98
}
99
99
100
+ /** @type {boolean | Promise<unknown> } */
100
101
let isSetup = false ;
101
102
102
103
/**
103
104
* @param {string } content
104
105
*/
105
106
async function addPageAnchors ( content ) {
106
107
if ( ! isSetup ) {
107
- await parser . prepareWasm ( saxWasmBuffer ) ;
108
- isSetup = true ;
108
+ isSetup = parser . prepareWasm ( saxWasmBuffer ) ;
109
109
}
110
+ await isSetup ;
110
111
111
112
const { headings, insertPoint } = getHeadingsOfHtml ( content ) ;
112
113
const pageAnchorsHtml = [ ] ;
You can’t perform that action at this time.
0 commit comments