Skip to content

Commit 2acab11

Browse files
add regex
1 parent 8b41897 commit 2acab11

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

packages/docs/src/routes/api/qwik/api.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@
17741774
}
17751775
],
17761776
"kind": "Function",
1777-
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nInstall a service worker which will prefetch the bundles.\n\nThere can only be one service worker per page. Because there can be many separate Qwik Containers on the page each container needs to load its prefetch graph using `PrefetchGraph` component.\n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n scope?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n nonce?: string;\n}) => JSXNode<'script'>\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n\n</td><td>\n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n</td><td>\n\nOptions for the prefetch service worker.\n\n- `base` - Base URL for the service worker `import.meta.env.BASE_URL` or `/`<!-- -->. Default is `import.meta.env.BASE_URL` - `scope` - Base URL for when the service-worker will activate. Default is `/` - `path` - Path to the service worker. Default is `qwik-prefetch-service-worker.js` unless you pass a path that starts with a `/` then the base is ignored. Default is `qwik-prefetch-service-worker.js` - `verbose` - Verbose logging for the service worker installation. Default is `false` - `nonce` - Optional nonce value for security purposes, defaults to `undefined`<!-- -->.\n\n\n</td></tr>\n</tbody></table>\n**Returns:**\n\n[JSXNode](#jsxnode)<!-- -->&lt;'script'&gt;",
1777+
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nInstall a service worker which will prefetch the bundles.\n\nThere can only be one service worker per page. Because there can be many separate Qwik Containers on the page each container needs to load its prefetch graph using `PrefetchGraph` component.\n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n scope?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n nonce?: string;\n}) => JSXNode<'script'>\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n\n</td><td>\n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n</td><td>\n\nOptions for the prefetch service worker.\n\n- `base` - Base URL for the service worker `import.meta.env.BASE_URL` or `/`<!-- -->. Default is `import.meta.env.BASE_URL` - `scope` - Base URL for when the service-worker will activate. Default is `/` - `path` - Path to the service worker. Default is `qwik-prefetch-service-worker.js` unless you pass a path that starts with a `/` then the base is ignored. Default is `qwik-prefetch-service-worker.js` - `verbose` - Verbose logging for the service worker installation. Default is `false` - `nonce` - Optional nonce value for security purposes, defaults to `undefined`<!-- -->.\n\n\n</td></tr>\n</tbody></table>\n**Returns:**\n\nJSXNode&lt;'script'&gt;",
17781778
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts",
17791779
"mdFile": "qwik.prefetchserviceworker.md"
17801780
},

packages/qwik/src/optimizer/src/plugins/vite-dev-server.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,16 @@ export async function configureDevServer(
142142

143143
const allModules = Array.from(server.moduleGraph.fileToModulesMap.entries());
144144

145-
const CSS_EXTENSIONS = ['.css', '.scss', '.sass', '.less', '.styl', '.stylus'];
146-
const JS_EXTENSIONS = ['.js', '.ts', '.tsx', '.jsx'];
145+
const CSS_EXTENSIONS = /\.(css|scss|sass|less|styl|stylus)$/;
146+
const JS_EXTENSIONS = /\.[mc]?[tj]sx?$/;
147147
const cssModules = allModules
148148
.flatMap(([_, modules]) => Array.from(modules))
149-
.filter((mod) => CSS_EXTENSIONS.some((ext) => mod.url.endsWith(ext)));
149+
.filter((mod) => CSS_EXTENSIONS.test(mod.url));
150150

151151
for (const mod of cssModules) {
152152
const hasJsImporter = Array.from(mod.importers).some((importer) => {
153153
const path = importer.url || importer.file;
154-
return path && JS_EXTENSIONS.some((ext) => path.endsWith(ext));
154+
return path && JS_EXTENSIONS.test(path);
155155
});
156156

157157
if (hasJsImporter) {

packages/qwik/src/optimizer/src/qwik-binding-map.ts

-10
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,5 @@ export const QWIK_BINDING_MAP = {
3030
"platformArchABI": "qwik.win32-x64-msvc.node"
3131
}
3232
]
33-
},
34-
"linux": {
35-
"x64": [
36-
{
37-
"platform": "linux",
38-
"arch": "x64",
39-
"abi": "gnu",
40-
"platformArchABI": "qwik.linux-x64-gnu.node"
41-
}
42-
]
4333
}
4434
};

0 commit comments

Comments
 (0)