diff --git a/.changeset/silver-trains-prove.md b/.changeset/silver-trains-prove.md new file mode 100644 index 0000000000..3faea500aa --- /dev/null +++ b/.changeset/silver-trains-prove.md @@ -0,0 +1,5 @@ +--- +"@patternfly/pfe-tools": patch +--- + +**Test Runner**: prevent config exception when lightdom shims are present diff --git a/tools/pfe-tools/dev-server/plugins/dev-server-router.ts b/tools/pfe-tools/dev-server/plugins/dev-server-router.ts index 89cfbe9965..3ad9422646 100644 --- a/tools/pfe-tools/dev-server/plugins/dev-server-router.ts +++ b/tools/pfe-tools/dev-server/plugins/dev-server-router.ts @@ -94,18 +94,18 @@ export function pfeDevServerRouterMiddleware( ): Router.Middleware { const { elementsDir, site: { componentSubpath } } = config; const router = new Router(); + const shim = lightdomShimMiddleware(config); + const demo = demoSubresourceMiddleware(config); return router - .get('/tools/pfe-tools/environment.js(.js)?', - environmentMiddleware(config)) - .get(`/core/pfe-core/:splatPath*.js`, - coreMiddleware(config)) - .get(`/${elementsDir}/:tagName/:splat.(css|html|js)`, - cacheBustingMiddleware(config)) - .get(`/${componentSubpath}/:unprefixedElementSlug/:moduleName*.js`, - elementDeclarationTypeScriptMiddleware(config)) - .get(`/${componentSubpath}/:unprefixedElementSlug/{demo/}?:sheetName-lightdom{:suffix}?.css`, - lightdomShimMiddleware(config)) - .get(`/${componentSubpath}/:unprefixedElementSlug/demo/{:demoName/}?:fileName.:ext`, - demoSubresourceMiddleware(config)) + .get('/tools/pfe-tools/environment.js(.js)?', environmentMiddleware(config)) + .get(`/core/pfe-core/:splatPath*.js`, coreMiddleware(config)) + .get(`/${elementsDir}/:tagName/:splat.(css|html|js)`, cacheBustingMiddleware(config)) + .get(`/${componentSubpath}/:unprefixedElementSlug/:moduleName*.js`, elementDeclarationTypeScriptMiddleware(config)) + .get(`/${componentSubpath}/:unprefixedElementSlug/demo/:sheetName-lightdom:suffix.css`, shim) + .get(`/${componentSubpath}/:unprefixedElementSlug/demo/:sheetName-lightdom.css`, shim) + .get(`/${componentSubpath}/:unprefixedElementSlug/:sheetName-lightdom:suffix.css`, shim) + .get(`/${componentSubpath}/:unprefixedElementSlug/:sheetName-lightdom.css`, shim) + .get(`/${componentSubpath}/:unprefixedElementSlug/demo/:demoName/:fileName.:ext`, demo) + .get(`/${componentSubpath}/:unprefixedElementSlug/demo/:fileName.:ext`, demo) .routes(); }