T
T
topuserman2020-12-19 22:35:44
css
topuserman, 2020-12-19 22:35:44

How to run webpack to build a finished project?

Working on a project, it became necessary to make changes to the front-end part, namely styles.
Project styles are written in scss preprocessor. The project already has webpack installed and configured - I have never worked with this tool.

The question is how to run it so that it rebuilds the project and spit out the css that is already there (i.e. replaced it).

In packege.json, in addition to dependencies and other things, a similar directive is indicated:

"scripts": {
    "dev": "env NODE_ENV=development webpack --config webpack.dev.js",
    "prod": "env NODE_ENV=production webpack --config webpack.production.js"
  },


I don’t understand, will it automatically start from environment variables to make friends with one or another config, or do I need to pass dev or prod parameters at startup?

And how to run it correctly? what commands? what to pay attention to?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Polyakov, 2020-12-20
@CIDBerlin

npx webpack

I
Il'ia Kartovitskii, 2020-12-21
@kartovitskii

npm run prod

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question