Export webpack / prepend module.exports package? Avoid empty object in node?

I am trying to use my bundle.js in my Node server, but apparently the webpack package is missing module.exports = before all the package code is at the top.

I can manually put module.exports = in this package, but there is a programmatic way to specify that the package should be exportable

0
source share
1 answer

Have you tried adding

 libraryTarget: 'umd' 

into webpack configuration. Check it out .

+1
source

All Articles