I am new to web development and been learning React by doing a small React project along with Firebase and Cloud Firestore. The bundler I am using is Parcel.
I understand that, a front end project, after being parcel build
, the so called production ready files should reside in the automatically generated dist
folder by default. And I can use firebase to deploy it. And I did manage to do that. However here are some questions I have after deploying the project.
- I thought Parcel will build my project by minifying all the js files I have to a single compressed js file(unless I explicitly write
parcel build index.html --no-minify
). So the deployed project should only come with that one js file without the overhead of passing every React components' js files to the client. But strangely I found all of the js files by inspectingSources
from the dev tool for my deployed project. Here is the screenshot.Is my understanding about bundling wrong? Or it is just because the config for Parcel is off?
- I also found the my
firebaseConfig.js
file by inspectingSources
from the dev tool for my deployed project, which contains theappid key
for my project. I don't know if this is safe and I don't know how to avoid this either. Consider that I am using the Web SDKs of Firebase and I didn't set up my own server for the project, is this exposing-your-appidKey thing inevitable in this case? - Lastly, after I
Parcel build
, I thought the minified js files would be small. But they are still huge. The.js.map
file is almost 8 mb. Is this normal?