When using CDN with AMD and you want to import local packages, it's the same for 3 and 4. The 4x documentation has some information here.
https://developers.arcgis.com/javascript/latest/amd-build/#configure-amd-to-load-custom-modules
When using ESM, you can import local ESM modules like any other ESM application. You said you want to export Map and View from your module? That could look like this.
// Edit, because I don't think this first option would work, since both
// are defaults and aren't named, better to use another option below.
// export * from 'https://js.arcgis.com/4.27/@arcgis/core/Map.js';
// export * from 'https://js.arcgis.com/4.27/@arcgis/core/views/MapView.js';
// another option
import Map from 'https://js.arcgis.com/4.27/@arcgis/core/Map.js';
import MapView from 'https://js.arcgis.com/4.27/@arcgis/core/views/MapView.js';
export Map;
export MapView;
// or
export { Map, MapView };
You just need to remember, the ESM CDN is for testing purposes only, you should not use it for a production application.