I have a react native web app. And I try to run the app with the webpack.config.js file.
So I installed webpack and webpack-cli. And Added in package.json this:
{
"name": "app",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start, react-app-rewired start ",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"lint": "eslint . --ext .js",
"postinstall": "patch-package",
"build": "webpack --config webpack.config.js",
"start-webpack": "webpack-dev-server --mode production --open"
},
"parserOptions": {
"parser": "@babel/eslint-parser",
"requireConfigFile": false
},
and the webpack.config.js file looks:
const createExpoWebpackConfigAsync = require("@expo/webpack-config");
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);
if (config.mode === "production") {
config.devServer.compress = false;
}
return config;
};
But I still get this error:
Parsing error: No Babel config file detected for C:reposDierenwelzijnDWL_frontendwebpack.config.js. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.eslint
But the file is located at this url.
Question: how to resolve this issue?
2
Answers
In your
.eslintrc.js
, add:If not there, add too:
I faced the same issue earlier. You need to add
requireConfigFile: false
to you.eslintrc.js
file.