mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
replace babel-plugin-module-alias with babel-plugin-module-resolver
This commit is contained in:
parent
e2a7c5f0e8
commit
990e39b13e
|
@ -39,7 +39,7 @@
|
|||
"babel-core": "6.17.0",
|
||||
"babel-generator": "6.17.0",
|
||||
"babel-loader": "6.2.5",
|
||||
"babel-plugin-module-alias": "1.6.0",
|
||||
"babel-plugin-module-resolver": "2.2.0",
|
||||
"babel-plugin-transform-async-to-generator": "6.16.0",
|
||||
"babel-plugin-transform-class-properties": "6.16.0",
|
||||
"babel-plugin-transform-object-rest-spread": "6.16.0",
|
||||
|
|
|
@ -87,14 +87,16 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
|
|||
'transform-class-properties',
|
||||
'transform-runtime',
|
||||
[
|
||||
'module-alias',
|
||||
[
|
||||
{ src: `npm:${babelRuntimePath}`, expose: 'babel-runtime' },
|
||||
{ src: `npm:${require.resolve('react')}`, expose: 'react' },
|
||||
{ src: `npm:${require.resolve('../../lib/link')}`, expose: 'next/link' },
|
||||
{ src: `npm:${require.resolve('../../lib/css')}`, expose: 'next/css' },
|
||||
{ src: `npm:${require.resolve('../../lib/head')}`, expose: 'next/head' }
|
||||
]
|
||||
'module-resolver',
|
||||
{
|
||||
alias: {
|
||||
'babel-runtime': babelRuntimePath,
|
||||
react: require.resolve('react'),
|
||||
'next/link': require.resolve('../../lib/link'),
|
||||
'next/css': require.resolve('../../lib/css'),
|
||||
'next/head': require.resolve('../../lib/head')
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue