Accessing webpack bundled libraries in the browser

后端 未结 3 884
余生分开走
余生分开走 2021-02-05 07:59

I\'m having trouble accessing a webpack bundled library from the browser.

Example: I have a class Foo

// foo.js

\"use strict\";

export de         


        
3条回答
  •  伪装坚强ぢ
    2021-02-05 08:52

    Looks like 'var' is the default for output.libraryTarget therefore you should be able to define your output.library property and you will be able to access the var globally. https://webpack.js.org/configuration/output/#output-librarytarget

提交回复
热议问题