mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
MDX: fix Webpack warnings
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-mdx': patch
|
||||
---
|
||||
|
||||
Fix Webpack warnings (they require absolute paths for dependencies)
|
||||
@@ -44,7 +44,7 @@ export function createMDX(createOptions: CreateMDXOptions = {}) {
|
||||
return (nextConfig: NextConfig = {}): NextConfig => {
|
||||
const loaderOptions: WebpackLoaderOptions = {
|
||||
...core.getOptions(),
|
||||
compiledConfigPath: core.getCompiledConfigPath(),
|
||||
absoluteCompiledConfigPath: path.resolve(core.getCompiledConfigPath()),
|
||||
isDev,
|
||||
};
|
||||
|
||||
@@ -105,8 +105,8 @@ export function createMDX(createOptions: CreateMDXOptions = {}) {
|
||||
},
|
||||
{
|
||||
test: metaLoaderGlob,
|
||||
enforce: 'pre',
|
||||
use: [
|
||||
options.defaultLoaders.babel,
|
||||
{
|
||||
loader: 'fumadocs-mdx/loader-meta',
|
||||
options: loaderOptions,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type Core, type CoreOptions, createCore } from '@/core';
|
||||
|
||||
export interface WebpackLoaderOptions extends CoreOptions {
|
||||
compiledConfigPath: string;
|
||||
absoluteCompiledConfigPath: string;
|
||||
isDev: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export default async function loader(
|
||||
): Promise<void> {
|
||||
const options = this.getOptions();
|
||||
this.cacheable(true);
|
||||
this.addDependency(options.compiledConfigPath);
|
||||
this.addDependency(options.absoluteCompiledConfigPath);
|
||||
|
||||
if (!instance) {
|
||||
instance = toWebpack(
|
||||
|
||||
@@ -13,7 +13,7 @@ export default async function loader(
|
||||
): Promise<void> {
|
||||
const options = this.getOptions();
|
||||
this.cacheable(true);
|
||||
this.addDependency(options.compiledConfigPath);
|
||||
this.addDependency(options.absoluteCompiledConfigPath);
|
||||
|
||||
if (!instance) {
|
||||
instance = toWebpack(
|
||||
|
||||
Reference in New Issue
Block a user