When webpack bundles your javascript it wraps all of your individual files/modules in functions so they are no longer run in the global scope, therefore if you want to make a variable global you have to explicitly set it on the window object, i.e.
window.a = 1;
WID=$(wmctrl -lp | grep $PID | cut "-d " -f1)
done
# Set the size and location of the window
# See man wmctrl for more info
wmctrl -i -r $WID -e 0,50,50,250,250
M. Mintz, S. Bills, R. Snow, and D. Jurafsky. Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP: Volume 2-Volume 2, page 1003--1011. Association for Computational Linguistics, (2009)
C. Siefkes, F. Assis, S. Chhabra, and W. Yerazunis. PKDD '04: Proceedings of the 8th European Conference on Principles and Practice of Knowledge Discovery in Databases, page 410--421. New York, NY, USA, Springer-Verlag New York, Inc., (2004)