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:
Sébastien Lorber 2021-06-22 17:36:51 +02:00 committed by GitHub
parent 4e88ea0a1a
commit 119c6d143e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 112 additions and 62 deletions

View file

@ -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();