single-spa / standalone-single-spa-webpack-plugin

A webpack plugin for running microfrontends in standalone mode.
MIT License
42 stars 8 forks source link

Cannot get local importMap to work #23

Closed stephenwil closed 2 years ago

stephenwil commented 2 years ago

Hi, In my webpack config, I'm specifying a local import map in order to recreate the imports as set by my root app: importMap: { imports: { "react": "https://cdn.jsdelivr.net/npm/react@16.13.1/umd/react.production.min.js", "react-dom": "https://cdn.jsdelivr.net/npm/react-dom@16.13.1/umd/react-dom.production.min.js" } }, and I can see them in the resultant webpack config if I debug, but they just aren't appearing in the import map as rendered locally. I'm having to add them in via the local UI to get it to work.

stephenwil commented 2 years ago

Realised the config I was messing around with used singleSpaDefaults(), which sets up an instance of StandaloneSingleSpaPlugin which was overriding my settings, however passing in via standaloneOptions fixed it.