MCPcopy
hub / github.com/QwikDev/qwik / serviceWorkerRegisterBuild

Function serviceWorkerRegisterBuild

scripts/qwik-city.ts:123–140  ·  view source on GitHub ↗
(swRegisterCode: string)

Source from the content-addressed store, hash-verified

121}
122
123function 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
142async function buildServiceWorker(config: BuildConfig) {
143 const build = await rollup({

Callers 1

buildViteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…