Skip to content

Commit

Permalink
fix(gatsby-theme-docz): remove webpack custom module resolution… (#1275)
Browse files Browse the repository at this point in the history
* ci: remove gatsby->docz-core dep. Add docz to gatsby example

* fix(gatsby-theme-docz): remove custom module resolution
  • Loading branch information
rakannimer authored Nov 25, 2019
1 parent c0e7109 commit 14580ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
14 changes: 0 additions & 14 deletions core/gatsby-theme-docz/lib/onCreateWebpackConfig.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
const fs = require('fs-extra')
const path = require('path')
const { Plugin, parseConfig } = require('docz-core')

const nodeModules = path.resolve(__dirname, 'node_modules')
const parentNodeModules = path.resolve(__dirname, '../../../node_modules')

module.exports = async (params, opts) => {
const { stage, actions, getConfig } = params
const hasParentNodeModules = fs.pathExistsSync(parentNodeModules)
const args = await parseConfig(opts)
const run = Plugin.runPluginsMethod(args.plugins)
const config = getConfig()
Expand All @@ -20,13 +14,5 @@ module.exports = async (params, opts) => {
})
}

if (hasParentNodeModules) {
actions.setWebpackConfig({
resolve: {
modules: [nodeModules, parentNodeModules],
},
})
}

run('onCreateWebpackConfig', params, stage === 'develop', args, config)
}
5 changes: 2 additions & 3 deletions core/gatsby-theme-docz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
"@theme-ui/typography": "^0.2.5",
"babel-plugin-export-metadata": "2.0.0-rc.69",
"copy-text-to-clipboard": "^2.1.0",
"docz": "2.0.0-rc.76",
"docz-core": "2.0.0-rc.75",
"emotion-theming": "^10.0.14",
"fs-extra": "^8.1.0",
"gatsby": "^2.13.27",
Expand Down Expand Up @@ -60,7 +58,8 @@
},
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react-dom": "^16.8.0",
"docz": ">=2.0.0"
},
"gitHead": "74932cd67112bacd1e29780a202d466acdd79535"
}
1 change: 1 addition & 0 deletions examples/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"serve": "gatsby serve"
},
"dependencies": {
"docz": "^2.0.0-rc.76",
"gatsby": "^2.13.73",
"gatsby-plugin-offline": "^2.2.7",
"gatsby-plugin-sharp": "^2.2.18",
Expand Down

0 comments on commit 14580ec

Please sign in to comment.