Я установил React-TagEditor, импортировал и попытался использовать как указано https://www.npmjs.com/package/react-tageditor, но я получаю эту ошибку
./node_modules/react-tageditor/src/TagEditor.js 140:19
Module parse failed: Unexpected token (140:19)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| var store = this.props.store
| if (!store) {
> return <div />
| }
|
Мои другие файлы как таковые
.babelr c
{
"presets": ["@babel/preset-react", "@babel/preset-env"]
}
webpack.config. js
module.exports = {
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015']
}
}
]
},
externals: {
"react": "React"
}
};
и пакет . json
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^8.0.4",
"babel-polyfill": "^6.26.0",
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"@babel/preset-react": "^7.0.0",
"css-loader": "^3.4.2",
"sass-pattern": "^0.1.10",
"sass-loader": "^8.0.2",
}
Хотя он указывает на babel-loader
, он по-прежнему говорит -> нужен соответствующий загрузчик для обработки этого типа файлов. Пожалуйста, помогите.