MrOnyancha
MrOnyancha

Reputation: 606

How can i deploy the Webpack Application using webpack dev server?

I have been building my application on web pack and testing using web pack. My biggest concerned is how can deploy it after the application is complete?

Do i need to use the 'Webpack' dev server for production or just deploy direct my 'dist' folder to production.

Upvotes: 1

Views: 1676

Answers (1)

Alexey Katayev
Alexey Katayev

Reputation: 248

No, you should not use webpack dev server on prod, and it's particularly said in docs. Yes, you should make a build with webpack, probably using another config (or having conditions in your config, e.g. depending on ENV variables). For example, you would probably want to run minifiers, or hash your files for cache busting. And then you just upload dist to your webserver (if you don't use any CI tools of course, in that case you should run a build there) and run apache, nginx or anything else there.

Upvotes: 4

Related Questions