Skip to content

Commit a9107f6

Browse files
committed
chore: fix 11ty / cem config
1 parent d53af31 commit a9107f6

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

eleventy.config.cjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const TocPlugin = require('@patternfly/pfe-tools/11ty/plugins/table-of-contents.
1717

1818
const markdownItAnchor = require('markdown-it-anchor');
1919

20+
const { $ } = require('execa');
21+
const path = require('node:path');
22+
2023
/** @param {import('@11ty/eleventy/src/UserConfig')} eleventyConfig */
2124
module.exports = function(eleventyConfig) {
2225
eleventyConfig.amendLibrary('md', md => md.use(markdownItAnchor));
@@ -36,6 +39,13 @@ module.exports = function(eleventyConfig) {
3639
/** Generate and consume custom elements manifests */
3740
eleventyConfig.addPlugin(CustomElementsManifestPlugin);
3841

42+
eleventyConfig.on('eleventy.before', async function() {
43+
const projectRoot = path.join(__dirname, '..', '..', '..', '..');
44+
await $({ cwd: path.join(projectRoot, 'elements') })`cem generate`;
45+
await $({ cwd: path.join(projectRoot, 'core', 'pfe-core') })`cem generate`;
46+
});
47+
48+
3949
/** Render docs based on custom elements manifests */
4050
eleventyConfig.addPlugin(CEMRenderPlugin);
4151

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"scripts": {
1414
"🐒-DEV": "❓ Development aids",
1515
"start": "wireit",
16+
"serve": "wireit",
1617
"dev": "wireit",
1718
"🚧-BUILD": "❓ Make packages and artifacts",
1819
"build": "wireit",
@@ -206,9 +207,7 @@
206207
"service": true,
207208
"command": "eleventy --serve",
208209
"dependencies": [
209-
"build:core",
210-
"analyze",
211-
"watch:analyze"
210+
"build:core"
212211
]
213212
},
214213
"start": {

0 commit comments

Comments
 (0)