dominicbirch / bundle-declarations-webpack-plugin

Webpack wrapper around dts-bundle
MIT License
8 stars 1 forks source link

Watch mode fails for CommonJS consumers #5

Closed dominicbirch closed 1 year ago

dominicbirch commented 1 year ago

see #2

dominicbirch commented 1 year ago

@pmwmedia it seems to be related to the naming of the split chunks by parcel; renaming the worker chunk and updating the require to be for .cjs resolves the issue. I will look at resolving this asap, but in the meantime, since I think you are using via ts-node > webpack.config.ts it might be easiest to update the following in your tsconfig.json so that it outputs esm (assuming no other impact by doing this, not sure what else you might be loading in this way :smile:)

  "ts-node": {
      "compilerOptions": {
          "module": "ESNext",
          "target": "ESNext",
      }
   }