paint-brush
React, JSX, ES Module Imports And Dynamic Imports In Browser Without Using Webpackby@DiS
354 reads
354 reads

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

by Kirill Konshin13mNovember 9th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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
Kirill Konshin

Kirill Konshin

@DiS

L O A D I N G
. . . comments & more!

About Author

Kirill Konshin HackerNoon profile picture
Kirill Konshin@DiS

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here