Skip to content

Commit

Permalink
feat: update Apollo v3 related dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Zakhar Dolozhevskiy committed Jun 2, 2020
1 parent 0166a49 commit 7c3edff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
}
},
"dependencies": {
"@apollo/client": "^3.0.0-beta.54",
"@apollo/react-ssr": "3.1.5",
"@apollo/react-testing": "3.1.4",
"@babel/cli": "7.8.4",
Expand Down Expand Up @@ -210,7 +211,7 @@
"apollo-link-debounce": "2.1.0",
"apollo-link-error": "1.1.13",
"apollo-link-http": "1.5.17",
"apollo-link-rest": "0.7.3",
"apollo-link-rest": "^0.8.0-beta.0",
"apollo-link-state": "0.4.2",
"autoprefixer": "9.7.6",
"babel-core": "7.0.0-bridge.0",
Expand Down Expand Up @@ -296,6 +297,7 @@
"json-merger": "1.1.2",
"leveldown": "5.6.0",
"loader-utils": "2.0.0",
"lodash-es": "^4.17.15",
"markdown-to-jsx": "6.11.1",
"module-alias": "2.2.2",
"moment": "2.25.3",
Expand Down
26 changes: 14 additions & 12 deletions src/configs/webpack/root/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@ import path from 'path'

import mhyConfig from '@/configs/mhy'

const alias = { ...mhyConfig.defaultAliases }
for (const [key, entry] of Object.entries(alias)) {
const defaultAliases = { ...mhyConfig.defaultAliases }
for (const [key, entry] of Object.entries(defaultAliases)) {
if (!fs.existsSync(entry)) {
alias[key] = path.resolve(process.cwd(), entry)
defaultAliases[key] = path.resolve(process.cwd(), entry)
} else {
// Make sure it's a resolved path indeed
alias[key] = path.resolve(entry)
defaultAliases[key] = path.resolve(entry)
}
}

if (process.env.WEBPACK_DEV_SERVER) {
alias['react-dom'] = '@hot-loader/react-dom'
defaultAliases['react-dom'] = '@hot-loader/react-dom'
}

export default () => ({
extensions: ['.js', '.mjs', '.jsx', '.css', '.scss', '.ts', '.tsx', '.json'],
modules: Array.from(
new Set([path.resolve(__dirname, '../../../../node_modules'), path.resolve(process.cwd(), 'node_modules')])
),
alias
})
export default ({ alias } = {}) => {
return {
extensions: ['.js', '.mjs', '.jsx', '.css', '.scss', '.ts', '.tsx', '.json'],
modules: Array.from(
new Set([path.resolve(__dirname, '../../../../node_modules'), path.resolve(process.cwd(), 'node_modules')])
),
alias: { ...defaultAliases, ...alias }
}
}

0 comments on commit 7c3edff

Please sign in to comment.