Open teodor-safeex opened 10 months ago
I agree that this is a somehow annoying behaviour - every time we switch from dev to prod build (and vice versa), we end up with an updated package.json
and yarn.lock
files that mess with the tracked project changes.
In addition, Quasar adds ssl-skip
v0.2.0 while there is newer version - v0.4.0 which is updated for Capacitor v6.
@rstoenescu , allow me to bump this report into your radar (I apologize if you are already aware of it).
What happened?
Building capacitor modifies
src-capacitor/package.json
-> it removes the empty line at the end of the file.This does not seem to behave the same way for the SPA application.
And even more weirdly, when run locally, if
@jcesarmobile/ssl-skip
is present, the build will remove it and keep the empty line at the end of the file. BUT if we try to build it again, it would then remove the empty line.What did you expect to happen?
Building the capacitor app should not modify
src-capacitor/package.json
Reproduction URL
https://stackblitz.com/edit/quasarframework-webpack-llippr?file=src-capacitor%2Fpackage.json,README.md
How to reproduce?
@jcesarmobile/ssl-skip
quasar build -m capacitor -T android -s -d
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), Capacitor Mode
Platforms/Browsers
No response
Quasar info output
Relevant log output
No response
Additional context
I haven't look into the actual code so I am not sure how relevant webpack/vite is to the capacitor build, but this happens with both vite and webpack.
Quasar internally adds and removes
@jcesarmobile/ssl-skip
. This is problematic because the whole install/removal is one of the cases in which the file is modified and can cause the removal of the empty line at the end of the package.json.I firmly believe Quasar should instead give a warning if
@jcesarmobile/ssl-skip
is present during builds, have an option to skip this and let developers deal with it themselves, or at the very least make sure it manually add an empty line, so that there are no semantic modifications.This is problematic if you want to do a
git diff
to see if there are any changes done to the code. While you can ignore whitespaces withgit diff --ignore-space-at-eol
, this should be fixed so it behaves similarly to the other modes.