React, JSX, ES Module Imports And Dynamic Imports In Browser Without Using Webpackby@DiS
341 reads

React, JSX, ES Module Imports And Dynamic Imports In Browser Without Using Webpack

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

React is distributed as UMD, it cannot be consumed by imports, even by the shimmed ones. We need to somehow patch the distributable to convince browser that it's a legit ES modules. We can use Service Workers to intercept and pre-process network requests. We've used the same approach to intercept the network requests and respond with slightly different content, in this case we use the. response response to the request and respond. to the network request and. respond to slightly different. content. There are two ways to do the.X compilation. and use Babel to pre-compile. or we can. use Service Worker.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - React, JSX, ES Module Imports And Dynamic Imports In Browser Without Using Webpack
Kirill Konshin HackerNoon profile picture

@DiS

Kirill Konshin

Receive Stories from @DiS

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa