fix(v2): Use require.resolve to resolve plugin path in presets (#2794)

This commit is contained in:
Sam Zhou 2020-05-22 16:57:02 -04:00 committed by GitHub
parent 20fbceb9f1
commit 1503943e3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 14 deletions

View file

@ -40,8 +40,11 @@ Presets in some way are a shorthand function to add plugins and themes to your d
```js
module.exports = function preset(context, opts = {}) {
return {
themes: ['@docusaurus/themes-cool', '@docusaurus/themes-bootstrap'],
plugins: ['@docusaurus/plugin-blog'],
themes: [
require.resolve('@docusaurus/themes-cool'),
require.resolve('@docusaurus/themes-bootstrap'),
],
plugins: [require.resolve('@docusaurus/plugin-blog')],
};
};
```