Closed W01fw00d closed 2 years ago
This will fix the necessity of using the local "hack" in src\utils\request.ts
in package.json, are dependencies and devDependencies declared correctly?
WARNING in asset size limit and entrypoint size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance. Assets: bundle.js (728 KiB)
WARNING in webpack performance recommendations: You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. For more info visit https://webpack.js.org/guides/code-splitting/
Removing the warning (but not the issue): https://stackoverflow.com/questions/49348365/webpack-4-size-exceeds-the-recommended-limit-244-kib
React code splitting and lazy loading: https://reactjs.org/docs/code-splitting.html
Do we need to have separate server-back,js and server.js for env and prod? Maybe we can have same server and it can change its behavior depending on process.env.NODE_ENV
nodemon vs node? We use both in package.json for different scripts.
nodemon just restarts the server anytime there's a change on development, similar to the react hot reload
--- Issue
It seems the devDependencies get installed but then uninstalled?
remote: -----> Pruning devDependencies
remote:
remote: > husky@4.2.1 preuninstall node_modules/husky
remote: > node husky uninstall
remote:
remote: husky > Uninstalling git hooks
remote: fatal: not a git repository (or any parent up to mount point /)
remote: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
remote: husky > Failed to uninstall
remote: removed 1577 packages and audited 188 packages in 26.645s
remote: found 2 vulnerabilities (1 moderate, 1 critical)
remote: run npm audit fix
to fix them, or npm audit
for details
In this case, it seems that husky uninstall failed...
Also, Cypress is still installed on heroku server...
--- Investigation
Both dependencies and devDependencies are installed during Heroku process, but the they uninstall the devDependencies:
"Pruning devDependencies"
https://devcenter.heroku.com/changelog-items/1376
So, even if Cypress is installed, it should be removed afterwards.
But this makes the deployment process slower, and it's innecessary. We can fix that changing the Heroku config:
https://devcenter.heroku.com/articles/nodejs-support#package-installation
heroku config:set NPM_CONFIG_PRODUCTION=true YARN_PRODUCTION=true
Can I move the webpack configs into a folder?
Move link.sh into a "dev-tools" folder
Set MONGODB_URL as a node env var and set it in https://dashboard.heroku.com/apps/cooking-with-amateurs/settings
React-Hot-Loader and DevTools warning messages appear on js console on prod...