mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
![Mariano Fernández Cocirio](/assets/img/avatar_default.png)
* Update babel-preset.js As './dist/server/build/babel/preset' now return a function, in this example we need to first call the function and after that replace styled-jsx * linting issues solved
18 lines
436 B
JavaScript
18 lines
436 B
JavaScript
const nextBabelPreset = require('next/babel')
|
|
|
|
/*
|
|
This code will load the 'styled-jsx-postcss/babel' package instead
|
|
of built-in 'styled-jsx/babel'
|
|
*/
|
|
|
|
let presetArray = nextBabelPreset()
|
|
|
|
presetArray.plugins = presetArray.plugins.map(plugin => {
|
|
if (!Array.isArray(plugin) && plugin.indexOf('styled-jsx/babel') !== -1) {
|
|
return require.resolve('styled-jsx-postcss/babel')
|
|
}
|
|
return plugin
|
|
})
|
|
|
|
module.exports = presetArray
|