My experience with Symfony5 and encore has been smooth until I attempted to deploy to production. In order to install dependencies, you can use the command npm install --production. To compile, run npm run build --prod.
I encountered an issue when trying to move @symfony/encore-webpack from devDependencies to dependencies. This resulted in an error prompting me to install node-sass and sass-loader, even though they are supposed to be in devDependencies.
Here is the error log:
(error log here)
This is how my package.json looks like:
(package.json contents here)
And this is my webpack.config.js:
(webpack config content here)