before using webpack, I put the code for calculating font-size in the header and immediately loaded it into the function. Now that I use Vue Family Bucket + webpack, I will put this calculation code in the created hook function of App.vue. It"s been used like this all the time, and there"s never been a problem.
but I think this method will be a bit stupid, I wonder if there is a module of webpack that can calculate font-size for html tags? But I searched for a long time, but I couldn"t find it. I don"t know how your project is done. Is it the same way to expose the "dirty code"?
there are many modules in the px-to-rem class, including gulp, but computing font-size can"t be found, and font-size can be written into css instead of tags with modules.
also, I copied NetEase"s JavaScript code for calculating font-size. Where did you copy your code? is there a common project code that is used by many big companies and big projects?
I just think my practice of "copying code casually on the Internet" and "finding a place to paste it and run" is not standard.