Skip to content

Commit

Permalink
docs: fix build, optimize watch
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Oct 14, 2024
1 parent e41af17 commit 66007ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions docs/_plugins/rhds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ export default async function(eleventyConfig: UserConfig, options?: Options) {
eleventyConfig.addWatchTarget('docs/theming/**/patterns/*.html');

for (const tagName of await readdir(join(cwd, './elements/'))) {
const dir = join(cwd, './elements/', tagName, 'docs/');
eleventyConfig.addWatchTarget(dir);
if (!tagName.includes('.')) {
const dir = join(cwd, './elements/', tagName, 'docs/');
eleventyConfig.addWatchTarget(dir);
}
}
};
8 changes: 5 additions & 3 deletions eleventy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ export default async function(eleventyConfig: UserConfig) {
eleventyConfig.addPassthroughCopy({
'node_modules/@lit/reactive-element': '/assets/packages/@lit/reactive-element',
});
eleventyConfig.addPassthroughCopy({ 'elements': '/assets/packages/@rhds/elements/elements/' });
eleventyConfig.addPassthroughCopy({ 'lib': '/assets/packages/@rhds/elements/lib/' });
eleventyConfig.addPassthroughCopy({ 'uxdot': '/assets/packages/@uxdot/elements/' });
const isNotTsbuild = (p: string) => !p.includes('.');
eleventyConfig.addPassthroughCopy({ 'elements': `/assets/packages/@rhds/elements/elements/` }, { filter: isNotTsbuild });
eleventyConfig.addPassthroughCopy({ 'lib': `/assets/packages/@rhds/elements/lib/` }, { filter: isNotTsbuild });
eleventyConfig.addPassthroughCopy({ 'uxdot': `/assets/packages/@uxdot/elements/` }, { filter: isNotTsbuild });
eleventyConfig.addPlugin(ImportMapPlugin, {
nodemodulesPublicPath: '/assets/packages',
manualImportMap: {
Expand Down Expand Up @@ -249,6 +250,7 @@ export default async function(eleventyConfig: UserConfig) {
'elements/rh-surface/rh-surface.js',
'elements/rh-table/rh-table.js',
'elements/rh-tag/rh-tag.js',
'elements/rh-cta/rh-cta.js',
],
});

Expand Down
2 changes: 1 addition & 1 deletion web-dev-server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const litcssOptions = {
};

export default pfeDevServerConfig({
tsconfig: 'tsconfig.json',
tsconfig: 'tsconfig.settings.json',
litcssOptions,
importMapOptions: {
typeScript: true,
Expand Down

0 comments on commit 66007ca

Please sign in to comment.