Require Webpack bundle — returns empty object?

前端 未结 3 798
星月不相逢
星月不相逢 2021-01-07 23:20

Update -- related: How to prepend module.exports = to webpack bundle?


I have webpack compile a simple module.exports = \"asdfasdf\" to foo.j

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-08 00:11

    I think you are missing the libraryTarget-setting. Adding libraryTarget: "commonjs2" to the config should fix the issue. See the webpack-docs about it.

提交回复
热议问题