I did not understand you, sorry…
This code will certainly not work in production. You can’t rely on the page name to stay the same, as it will undergo minification when built with --prod and thus have a different page name when in production mode.
“You will have to find all alternate route for figuring out the current page name, or restructure so that you don’t need to know what the current page is outside of it’s respective class.”