-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps): update @shikijs/vitepress-twoslash to 1.5.0 #16637
Conversation
Run & review this pull request in StackBlitz Codeflow. |
docs/config/build-options.md
Outdated
```js twoslash | ||
/** @type {import('vite').UserConfig} */ | ||
const config = { | ||
build: { | ||
// ---cut-before--- | ||
modulePreload: { | ||
resolveDependencies: (filename, deps, { hostId, hostType }) => { | ||
return deps.filter(condition) | ||
}, | ||
}, | ||
// ---cut-after--- | ||
// ---cut-before--- | ||
modulePreload: { | ||
resolveDependencies: (filename, deps, { hostId, hostType }) => { | ||
return deps.filter(condition) | ||
}, | ||
}, | ||
// ---cut-after--- | ||
}, | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I forgot about dedenting when implementing twoslashes/twoslash#33 😅. I noticed that we can simply this by putting the prettier-ignore
inside.
/** @type {import('vite').UserConfig} */
const config = {
// prettier-ignore
build: {
// ---cut-before---
modulePreload: {
resolveDependencies: (filename, deps, { hostId, hostType }) => {
return deps.filter(condition)
},
},
// ---cut-after---
},
}
@bluwy Adjusted according to @sapphi-red 's suggestion, now there is no indentation. But now there is no scene with a space before the cut comment. 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me 👍 But I also wonder if we could use a Shiki transformer to automatic dedent the twoslash code blocks.
Description
twoslashes/twoslash#33 Implemented twoslash to support adding spaces in front of cut comments, so
<!-- prettier-ignore-start -->
can be removed.