Skip to content

Commit 990e39b

Browse files
committed
replace babel-plugin-module-alias with babel-plugin-module-resolver
1 parent e2a7c5f commit 990e39b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"babel-core": "6.17.0",
4040
"babel-generator": "6.17.0",
4141
"babel-loader": "6.2.5",
42-
"babel-plugin-module-alias": "1.6.0",
42+
"babel-plugin-module-resolver": "2.2.0",
4343
"babel-plugin-transform-async-to-generator": "6.16.0",
4444
"babel-plugin-transform-class-properties": "6.16.0",
4545
"babel-plugin-transform-object-rest-spread": "6.16.0",

server/build/webpack.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,16 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
8787
'transform-class-properties',
8888
'transform-runtime',
8989
[
90-
'module-alias',
91-
[
92-
{ src: `npm:${babelRuntimePath}`, expose: 'babel-runtime' },
93-
{ src: `npm:${require.resolve('react')}`, expose: 'react' },
94-
{ src: `npm:${require.resolve('../../lib/link')}`, expose: 'next/link' },
95-
{ src: `npm:${require.resolve('../../lib/css')}`, expose: 'next/css' },
96-
{ src: `npm:${require.resolve('../../lib/head')}`, expose: 'next/head' }
97-
]
90+
'module-resolver',
91+
{
92+
alias: {
93+
'babel-runtime': babelRuntimePath,
94+
react: require.resolve('react'),
95+
'next/link': require.resolve('../../lib/link'),
96+
'next/css': require.resolve('../../lib/css'),
97+
'next/head': require.resolve('../../lib/head')
98+
}
99+
}
98100
]
99101
]
100102
}

0 commit comments

Comments
 (0)