“require is not defined” Using webpack 2

前端 未结 3 1651
暗喜
暗喜 2020-12-16 22:23

I\'m having problems with bundle my app using webpack, I\'ve reading in the site similar problems though I\'ve trying all the recommendations and I can\'t figure it out what

3条回答
  •  孤街浪徒
    2020-12-16 23:03

    You're using an incorrect target:

    target: 'node'
    

    This means that the bundle is intended to be used in a Node.js (server-side) program, not a browser. You can change it to web, or just remove that line (because web is the default).

提交回复
热议问题