Expose javascript globals bundled via webpack

后端 未结 5 2051
鱼传尺愫
鱼传尺愫 2020-12-09 03:54

The Problem

I feel like this should be more straightforward than it is. I need to access all my javascript libraries from the frontend and because I\'m integrating

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 04:39

    It sounds like what the OP was looking for was the exports-loader instead of the the expose-loader.

    To expose modules, use the expose-loader.

    To expose global variables, use the exports-loader

    This is one of those deals where the answer is clearly documented, but you had to be aware of the thing you're looking for first and know its name. It doesn't help matters that these two similar loaders were also given similar names.

提交回复
热议问题