diff --git a/docs/guide/using-vue.md b/docs/guide/using-vue.md index 3090b1cd06..e7e88dc4d0 100644 --- a/docs/guide/using-vue.md +++ b/docs/guide/using-vue.md @@ -121,6 +121,35 @@ Inside any markdown file you can then directly use the components (names are inf Make sure a custom component's name either contains a hyphen or is in PascalCase. Otherwise it will be treated as an inline element and wrapped inside a `
` tag, which will lead to hydration mismatch because `
` does not allow block elements to be placed inside it. ::: +### Using Pre-processors + +VuePress has built-in webpack config for the following pre-processors: `sass`, `scss`, `less`, `stylus` and `pug`. All you need to do is installing the corresposnding dependencies. For example, to enable `sass`, install the following in your project: + +``` bash +yarn add -D sass-loader node-sass +``` + +Now you can use the following in markdown and theme components: + +``` vue + +``` + +Using `` requires installing `pug` and `pug-plain-loader`: + +``` bash +yarn add -D pug pug-plain-loader +``` + +::: tip +If you are a Stylus user, you don't need to install `stylus` and `stylus-loader` in your project because VuePress uses Stylus internally. + +For pre-processors that do not have built-in webpack config support, you will need to [extend the internal webpack config](../config/#configurewebpack) in addition to installing the necessary dependencies. +::: + ## Script & Style Hoisting Sometimes you may need to apply some JavaScript or CSS only to the current page. In those cases you can directly write root-level `