Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack compile file to S3 or CDN Server

i'm working on React Project Javascript universal (Express.js as server) in the production build, i'm using webpack and babel as a bundling and transpiler.

Everything work fine,

However, i'm thinking that, those bundles are actually just static javascript, styles and html.

Can we upload it to Amazon S3 and link it with Cloudfront and make these files available over CDN?

I try googling searching for webpack and CDN but didn't find any useful information.

Or did i misunderstand something? Will it work like what i think? And can we automate this using just webpack cli ?

Please advise,

like image 582
chaintng Avatar asked Oct 29 '22 22:10

chaintng


1 Answers

Webpack is mostly concerned about the building (and bundling) of your assets. What you do with them/where you host them is up to you, and you might want to look into some kind of CI process/tool to manage automated deployments for you, once the bundles are built. Webpack doesn't (afaik) handle deployment.

like image 97
John Avatar answered Nov 26 '22 03:11

John