Unverified Commit 104b8d47 authored by Kristoffer K's avatar Kristoffer K Committed by GitHub

fix(next-mdx): resolve webpack loader (#17983)

**What's the problem this PR addresses?**

`@next/mdx` adds the webpack loader `@mdx-js/loader` without resolving it to an absolute path

Depends on https://github.com/vercel/next.js/pull/17606

**How did you fix it?**

`require.resolve` the webpack loader before adding it
parent 246c265f
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
}, },
"dependencies": { "dependencies": {
"@mdx-js/loader": "^1.5.1", "@mdx-js/loader": "^1.5.1",
"@mdx-js/react": "^1.6.18",
"@next/mdx": "^9.1.1", "@next/mdx": "^9.1.1",
"next": "latest", "next": "latest",
"react": "^16.8.6", "react": "^16.8.6",
......
...@@ -8,7 +8,7 @@ module.exports = (pluginOptions = {}) => (nextConfig = {}) => { ...@@ -8,7 +8,7 @@ module.exports = (pluginOptions = {}) => (nextConfig = {}) => {
use: [ use: [
options.defaultLoaders.babel, options.defaultLoaders.babel,
{ {
loader: '@mdx-js/loader', loader: require.resolve('@mdx-js/loader'),
options: pluginOptions.options, options: pluginOptions.options,
}, },
], ],
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"directory": "packages/next-mdx" "directory": "packages/next-mdx"
}, },
"peerDependencies": { "peerDependencies": {
"@mdx-js/loader": ">=0.15.0" "@mdx-js/loader": ">=0.15.0",
"@mdx-js/react": "*"
} }
} }
declare -a testCases=( declare -a testCases=(
"with-typescript" "with-typescript"
"with-next-sass" "with-next-sass"
"with-mdx"
) )
set -e set -e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment