Skip to content

Commit

Permalink
fix(gatsby-plugin-netlify-cms): react18-compatible require resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
kspeyanski committed Apr 11, 2022
1 parent 408247f commit 123bfd4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/gatsby-plugin-netlify-cms/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,23 @@ exports.onCreateWebpackConfig = (
({ name, assetName, sourceMap, assetDir }) =>
[
{
from: require.resolve(path.join(name, assetDir, assetName)),
from: path.join(
path.dirname(
require.resolve(path.join(name, `package.json`))
),
assetDir,
assetName
),
to: assetName,
},
sourceMap && {
from: require.resolve(path.join(name, assetDir, sourceMap)),
from: path.join(
path.dirname(
require.resolve(path.join(name, `package.json`))
),
assetDir,
sourceMap
),
to: sourceMap,
},
].filter(Boolean)
Expand Down

0 comments on commit 123bfd4

Please sign in to comment.