Answer the question
In order to leave comments, you need to log in
How to make webpack friends with legacy code (many global variables)?
Hello!
There is a big project where it was decided to implement webpack. There is a bunch of legacy code that has a lot of global variables. for example:
2 files are connected in html
<script src="example.js"></script>
<script src="dosomething.js"></script>
function example(num) {
//...
}
function example1(str) {
//...
}
function example2(str) {
//...
}
var exampleNum = 1;
var exampleStr = 'example';
example(exampleNum);
example1(exampleStr);
example2(exampleStr);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question