Closed AlexandreAkao closed 2 years ago
Our webpack configs use the orgName as a scope to define webpack external
s. Per the create-single-spa documentation,
This changes whether package names that start with @your-org-name are treated as webpack externals or not. Defaults to true.
Set orgPackagesAsExternal: false
in the singleSpaDefaults config and then either
When I set orgPackagesAsExternal: false
shows a new error:
This is my webpack:
process.env
is only compatible with Node but your code is making use of it somewhere. You need to compile it away, see webpack's EnvironmentPlugin or DefinePlugin.
These configs are intended to be a starting point. Not a one-size-fits-all solution like CRA or similar so keep that in mind.
Seems like this could have also been caused by your use of streamBrowserify https://stackoverflow.com/questions/68542553/webpack-5process-is-not-defined-triggered-by-stream-browserify but the solution is the same.
Setting the ProvidePlugin on Webpack.config the process.env
shows, but with no values
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
}),
]
I'm migrating from a CRA project, so will be perfect if the envs be similar in the CRA, with all presets envs that CRA provides
We intentionally don't provide a full replacement for CRA. It may also be a good idea to compare CRA's webpack config with our basic webpack config so that you can enable the missing features yourself. See our FAQ here for some basic info and potential alternatives: https://single-spa.js.org/docs/faq/#create-react-app We unfortunately don't have the resources to do this on behalf of every user who wants to migrate.
Okay fine, thanks a lot for the support 😊
Only for information I found this plugin and work perfectly for environment variables https://github.com/mrsteele/dotenv-webpack
Hello guys I'm facing this error:
But
@ambevtech/wms-push-notification-react-client
is only used in one micro frontend, I don't wanna share it with other micro frontends.I know that probably will solve if I add this
@ambevtech/wms-push-notification-react-client
on import-map, but it is a private dependency that requires authentication.This is my import-map:
Does anyone know how to solve this?
Thanks for the help :)