Define global variable with webpack

后端 未结 5 1737
臣服心动
臣服心动 2020-11-22 11:16

Is it possible to define a global variable with webpack to result something like this:

var myvar = {};

All of the examples I saw were using

5条回答
  •  日久生厌
    2020-11-22 11:48

    You can use define window.myvar = {}. When you want to use it, you can use like window.myvar = 1

提交回复
热议问题