mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-25 12:38:57 +02:00
feat(v2): plugins injectHtmlTags + configureWebpack should receive content loaded (#5037)
* more lifecycles should receive plugin loaded content * refactor docs/blog plugins to use newly injected loaded plugin content instead of a mutable variable * update lifecycle docs * update lifecycle docs * fix failing tests
This commit is contained in:
parent
4e88ea0a1a
commit
119c6d143e
12 changed files with 112 additions and 62 deletions
|
@ -309,6 +309,8 @@ describe('simple website', () => {
|
|||
test('configureWebpack', async () => {
|
||||
const {plugin} = await loadSite();
|
||||
|
||||
const content = await plugin.loadContent?.();
|
||||
|
||||
const config = applyConfigureWebpack(
|
||||
plugin.configureWebpack,
|
||||
{
|
||||
|
@ -319,6 +321,8 @@ describe('simple website', () => {
|
|||
},
|
||||
},
|
||||
false,
|
||||
undefined,
|
||||
content,
|
||||
);
|
||||
const errors = validate(config);
|
||||
expect(errors).toBeUndefined();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue