mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Simplify with-absolute-imports example (#5812)
* Delete .babelrc * Update package.json * Create next.config.js * Update next.config.js
This commit is contained in:
parent
dada692bd6
commit
cdd5129ef3
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"presets": ["next/babel"],
|
||||
"plugins": [
|
||||
[
|
||||
"module-resolver",
|
||||
{
|
||||
"root": ["./"],
|
||||
"alias": {
|
||||
"components": "./components"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
8
examples/with-absolute-imports/next.config.js
Normal file
8
examples/with-absolute-imports/next.config.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
webpack (config, options) {
|
||||
config.resolve.alias['components'] = path.join(__dirname, 'components')
|
||||
return config
|
||||
}
|
||||
}
|
|
@ -8,8 +8,5 @@
|
|||
"next": "latest",
|
||||
"react": "^16.1.1",
|
||||
"react-dom": "^16.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-module-resolver": "^3.1.1"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue