mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
add notes about skips (#1419)
* add notes about skips * prettier * re-add support for 'unpublished: true' * prettier
This commit is contained in:
@@ -160,6 +160,15 @@ export default async function (eleventyConfig) {
|
||||
// Use our own markdown instance
|
||||
eleventyConfig.setLibrary('md', markdown);
|
||||
|
||||
// for files with `unpublished: true`, it will make sure they do not make it into the final build at all, but will be usable in development.
|
||||
eleventyConfig.addPreprocessor('unpublished', '*', (data, content) => {
|
||||
if (data.unpublished && process.env.ELEVENTY_RUN_MODE === 'build') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return content;
|
||||
});
|
||||
|
||||
// Add anchors to headings
|
||||
eleventyConfig.addTransform('doc-transforms', function (content) {
|
||||
let doc = HTMLParse(content, { blockTextElements: { code: true } });
|
||||
|
||||
@@ -123,6 +123,7 @@ export async function build(options = {}) {
|
||||
function generateReactWrappers() {
|
||||
// Used by webawesome-app to make re-rendering not miserable with extra React file generation.
|
||||
if (process.env.SKIP_SLOW_STEPS === 'true') {
|
||||
spinner.info('Skipping React Wrapper generation.');
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -162,6 +163,7 @@ export async function build(options = {}) {
|
||||
async function generateTypes() {
|
||||
// Used by webawesome-app to make re-rendering not miserable with extra TS compilations.
|
||||
if (process.env.SKIP_SLOW_STEPS === 'true') {
|
||||
spinner.info('Skipping TypeScript compiler.');
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user