arackaf / customize-cra

Override webpack configurations for create-react-app 2.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getBabelLoader().options is undefined when you fix babel-loader

bestycw opened this issue · comments

Because ths history reason, i cant eject react project.so i have to fix react-scritpts to match my project.
But when i change webpack.config.js :
{
test: /.(js|mjs|jsx|ts|tsx)$/,
include: paths.appSrc,
// loader: require.resolve('babel-loader'),
//options:{...}
use:[
{other loader},
{babel-loader}
]
}
It will throw error:
TypeError: Cannot read properties of undefined (reading 'options')

By reading the source code and identifying the problem, getBabelLoader did not consider the case where use is an array.