diff --git a/gatsby-config.js b/gatsby-config.js index a55a576..7f4bc3f 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -125,6 +125,7 @@ module.exports = { 'gatsby-plugin-sitemap', 'gatsby-transformer-json', 'gatsby-transformer-sharp', + '@ayan4m1/gatsby-plugin-root-import', { resolve: 'gatsby-transformer-source-code', options: { diff --git a/gatsby-node.js b/gatsby-node.js index 702d086..d7a471a 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -154,11 +154,3 @@ exports.createPages = async (options) => { await createArticlePages(options); await createTriviaPages(options); }; - -exports.onCreateWebpackConfig = ({ actions }) => { - actions.setWebpackConfig({ - resolve: { - modules: [resolve(__dirname, 'src'), 'node_modules'] - } - }); -}; diff --git a/package.json b/package.json index e656878..30e839a 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "prepare": "husky" }, "dependencies": { + "@ayan4m1/gatsby-plugin-root-import": "^2.0.10", "@babel/core": "^7.25.2", "@fortawesome/fontawesome-svg-core": "^6.6.0", "@fortawesome/free-brands-svg-icons": "^6.6.0", diff --git a/yarn.lock b/yarn.lock index bb52211..e405bf9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,6 +33,11 @@ signedsource "^1.0.0" yargs "^15.3.1" +"@ayan4m1/gatsby-plugin-root-import@^2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@ayan4m1/gatsby-plugin-root-import/-/gatsby-plugin-root-import-2.0.10.tgz#e76e2bba2db59773a7c29ec9718dc31dcbde97ec" + integrity sha512-Now6pVcLPuCKexuBuwiUsZ4FTtB06iplmj6VcPN2jIt4cP0HvQqFnESzrJOO6g9lhWuQpUEyynWAQFiZRcoGpA== + "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"