fix(v2): pass images in static dir to webpack-loader (#3283)

* pass static images to webpack-loader

* remove console.log

* fix windows path issue

* fix windows path issue

* add missing deps
This commit is contained in:
Anshul Goyal 2020-08-15 01:03:08 +05:30 committed by GitHub
parent eb4aa19bef
commit 12e9ff6232
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 26 deletions

View file

@ -27,7 +27,10 @@ import {Configuration, Loader} from 'webpack';
import admonitions from 'remark-admonitions';
import {PluginOptionSchema} from './pluginOptionSchema';
import {ValidationError} from '@hapi/joi';
import {DEFAULT_PLUGIN_ID} from '@docusaurus/core/lib/constants';
import {
DEFAULT_PLUGIN_ID,
STATIC_DIR_NAME,
} from '@docusaurus/core/lib/constants';
import {PluginOptions, LoadedContent, Metadata} from './types';
@ -178,6 +181,7 @@ export default function pluginContentPages(
options: {
remarkPlugins,
rehypePlugins,
staticDir: path.join(siteDir, STATIC_DIR_NAME),
// Note that metadataPath must be the same/in-sync as
// the path from createData for each MDX.
metadataPath: (mdxPath: string) => {