From https://webpack.js.org/guides/installation/ and https://webpack.js.org/guides/production/,
I am not able to understand how the build files are made available in production environment since webpack is installed as a devDependency (https://webpack.js.org/guides/installation/#local-installation).
So in production npm install will be run with the --production flag. As a result, the devDependencies are not installed and no webpack command could be run.
How the build files are made available in production environment ?
You should understand that using a source code to build a dev mode or build a production, not using a production build to a production.
@aloupfor this is a good question but it's more of general front end development than webpack-specific one. To elaborate on @pierreneter's explanation a bit...
In general, the __Guides__ are walking through how to develop a site or application, _not a typical node package_. So, even though these projects are NPM based in order to manage dependencies, _they are not deployed to npm_ to be consumed by other projects.
Site and application projects use the package.json sections slightly differently than library packages (i.e. packages deployed to NPM). The devDependencies section is used to contain build process utilities/packages, while the dependencies section contains the actual dependencies consumed by modules within /src (e.g. leaflet). Think of dependencies as packages that are actually used at runtime.
The --production flag is typically used only for projects _deployed to npm_. With this in mind, npm install --production is a different kind of "production" environment than what we are discussing in the guides. "Production" in npm terms means deployed to npm while "Production" for our examples means deployed to web server or as a native application using something like electron.
The line is definitely a bit blurry so I completely understand the confusion. However, as long this is the recommended practice within the community, I don't really see us recommending something different. If the community did change the direction of this, we'd be happy to as well but understand that this would be a much larger documentation problem than just on this site.
cc @TheLarkInn (feel free to elaborate or correct anything I've mentioned here)
So it was more a npm related question.
I had a hard time to figure out the difference between production and production.
I was able to understand the difference with your explanations
Thank you @pierreneter and @skipjack, I really learned something.