score:1

Accepted answer

the problem ended up being an issue where the output of our bundle was separated into main.js and vendor.js, but we were only loading the main.js into the parent app.

score:0

add a node entry with global: true to your config:

node: {
    global: true,
    __filename: false,
    __dirname: false,
  },

score:0

webpack does behave a bit strange when it comes to windows object and we can site number of discussions on this matter.

according to this answer adding globalobject: 'this' line to the output section in webpack config file might fix the issue.

other references https://github.com/webpack/webpack/issues/7112 https://github.com/markdalgleish/static-site-generator-webpack-plugin/issues/130


Related Query

More Query from same tag