I renamed src/ to frontend/ and after this I have it searching in old folder src/:
$ npm run build
> [email protected] build
> react-scripts build
Could not find a required file.
Name: index.js
Searched in: /home/porton/Projects/passport_client_dfinity/src
despite I have created webpack.config.js:
const path = require('path');
// webpack.config.js
module.exports = {
entry: './frontend/index.js',
resolve: {
modules: [path.resolve(__dirname, 'frontend'), 'node_modules'],
},
};
Here is package.json:
{
"name": "passport_client_dfinity",
"version": "0.1.0",
"private": true,
"dependencies": {
"@dfinity/agent": "^0.20.2",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.70",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@web3-onboard/core": "^2.21.2",
"@web3-onboard/injected-wallets": "^2.10.11",
"@web3-onboard/react": "^2.8.13",
"@web3-onboard/walletconnect": "^2.5.3",
"bootstrap": "^5.3.2",
"ethers": "^6.10.0",
"react": "^18.2.0",
"react-bootstrap": "^2.9.2",
"react-dom": "^18.2.0",
"react-spinners": "^0.13.8",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"backend": "dfx deploy backend && env -i scripts/read-env.sh",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"sources": "mops sources"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"browser": {
"fs": false,
"os": false,
"path": false
},
"devDependencies": {
"react-scripts": "^5.0.1"
}
}