material-ui UMD externals

Created on 4 Feb 2020  路  4Comments  路  Source: mui-org/material-ui

I am producing a vendor from the node_modules umd file.
/node_modules/@material-ui/core/umd/material-ui.production.min.js
I'm doing the same in react.js
/node_modules/react/umd/react.production.min.js',

but I do not extract material-ui from the file size and show the umd reference. I could not find any documents and examples about it.

what I'm trying to do is:
Provide material-ui read from one place for microfrontend projects.
I am trying to extract this from their file size as well.

DBDB2019-AAAF-43ED-9FE7-340045AB79D6
5819A36B-F432-4AD0-BF11-939EE9F95EC3_1_105_c
14B8B2A6-4B3A-4AE6-9B6A-9DDA2C15881A

question

All 4 comments

The UMD build is for prototyping only.

https://material-ui.com/getting-started/installation/#cdn

Can't remove the material-ui package without compiling and reference the cdn? I request in the compilation of my joint projects. They all have a material-ui package.

const externalForMaterialUi = (context, request, callback) => { if (/@material-ui.+/.test(request)) { const name = request.replace(/^.*[\\\/]/, '') return callback(null, 'root MaterialUI.' + name); } callback(); }

I take out a package this way but it doesn't see the CDN reference.

I am also facing the same issue. When I try to exclude all material-ui packages from my micro-frontend bundle, It cannot load from CDN. Is thre any way to do this? Actually it's been a week I am trying to exclude material packages but non of the solutions I have found on the web worked for me.

The way I exclude material-ui packages is like this;

function externalForMaterialUi(context, request, callback) { if (/@material-ui.+/.test(request)) { const name = request.replace(/^.*[\\\/]/, '') return callback(null, 'root MaterialUI.' + name); } callback(); }

The CDN reference is like this;
<script src="https://unpkg.com/@material-ui/[email protected]/umd/material-ui.development.js" crossorigin="anonymous"></script>
I will be very glad If a genius developer guide me through this. Thanks in advance.

D2500CEF-B274-4438-945C-306A60D7BD8D
EA4F3E2C-D049-4585-9A5C-1FFC1A71B606_4_5005_c
D18F6C13-8FA0-4F78-8116-8FDFD5A47F21_1_105_c

This way I unpacked.
But when opening the screen I get the error as below. It does not see the UMD or CDN reference. It doesn't even recognize HTML CDN import.
A8D2C133-5FFA-4BEC-9566-20E685F5B7E9_1_105_c

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sys13 picture sys13  路  3Comments

anthony-dandrea picture anthony-dandrea  路  3Comments

reflog picture reflog  路  3Comments

revskill10 picture revskill10  路  3Comments

mattmiddlesworth picture mattmiddlesworth  路  3Comments