( options = {} )
| 202 | |
| 203 | bundles = [] |
| 204 | async getSavedAppBundles ( options = {} ) { |
| 205 | const { |
| 206 | keepBundlesInMemory = true |
| 207 | } = options |
| 208 | |
| 209 | if ( !keepBundlesInMemory ) { |
| 210 | // console.log('Getting bundles from file') |
| 211 | return await fs.readJson('./static/app-bundles.json') |
| 212 | } |
| 213 | |
| 214 | // From here we get and store bundles |
| 215 | |
| 216 | |
| 217 | // Check if any bundles are already in memory |
| 218 | if ( this.bundles.length === 0 ) { |
| 219 | // console.log('Storing bundles to memory') |
| 220 | this.bundles = await fs.readJson('./static/app-bundles.json') |
| 221 | } |
| 222 | |
| 223 | // console.log('Getting bundles from memory') |
| 224 | return this.bundles |
| 225 | } |
| 226 | |
| 227 | // Load the bundles from files |
| 228 | // so that we don't have to keep them in memory |
no outgoing calls
no test coverage detected