(swRegisterCode: string)
| 121 | } |
| 122 | |
| 123 | function serviceWorkerRegisterBuild(swRegisterCode: string) { |
| 124 | const filter = /\@qwik-city-sw-register-build/; |
| 125 | |
| 126 | const plugin: Plugin = { |
| 127 | name: 'serviceWorkerRegisterBuild', |
| 128 | setup(build) { |
| 129 | build.onResolve({ filter }, (args) => ({ |
| 130 | path: args.path, |
| 131 | namespace: 'sw-reg', |
| 132 | })); |
| 133 | build.onLoad({ filter: /.*/, namespace: 'sw-reg' }, () => ({ |
| 134 | contents: swRegisterCode, |
| 135 | loader: 'text', |
| 136 | })); |
| 137 | }, |
| 138 | }; |
| 139 | return plugin; |
| 140 | } |
| 141 | |
| 142 | async function buildServiceWorker(config: BuildConfig) { |
| 143 | const build = await rollup({ |
no outgoing calls
no test coverage detected
searching dependent graphs…