Answer the question
In order to leave comments, you need to log in
How does a modern frontend deploy?
Hello. The question is more theoretical than practical. I'm trying to understand the intricacies of the modern frontend, and no matter what screencasts I watch, no matter what boilerplates I analyze, the approach is the same everywhere: webpack and all script and style preprocessors are installed as developer dependencies, i.e. they are not in production. At the same time, for webpack, as a rule, 2 versions of the config are created: development and production, and the config is selected depending on the value of the NODE_ENV environment variable. And in all the tutorials that I met, one important moment for me is omitted. How does deployment happen? When NODE_ENV is set to 'production', is it passed to the console?
At the beginning of my dive, I thought that there would be some githook that would run the build, but if it’s customary not to put the webpack and the attached one into production, then there are some practices that are unfamiliar to me =)
Answer the question
In order to leave comments, you need to log in
You can look at tools like shipit and flightplan . The first one is more modular, has some plugins, and also supports the "rolling releases" function (somewhat similar to capistrano for ruby or deployer for php), the second one is more simplified.
There are different deployment options - you can build it locally or on the build-server and upload it to the production, or you can collect it already on the production. Everyone chooses what he likes.
What do you mean not accepted?
git clone yourrepo
npm install
npm deploy deploy
script calls webpack/gulp or whatever with production options
More masterful is to use docker.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question