Jay Jeong
Jay Jeong

Reputation: 994

Why should I not use webpack-dev-server in production?

I have deployed my app which is built with webpack-dev-server through AWS ec2-instance. It says I should change it to production. What is the difference between deploying in development and production? If the development server compiles every assets and components into a bundle too, what is the benefit of using production?

Additional question: When setting a start script to start webpack-dev-server, I saw people writing it as

  "scripts": {
      "start": "webpack-dev-server --entry ./src/js/app.js --output-filename ./dist/bundle.js"
  }

from it, what is the reason for prepending --output to -filename? I tried writing without it and apparently it works fine. I looked up the documentation, but couldn't find what I was looking for. could someone tell me what that is if one knows? Thank you.

Upvotes: 3

Views: 1725

Answers (1)

pfcodes
pfcodes

Reputation: 1086

Optimizations and security are the biggest factors.

Upvotes: 1

Related Questions