A
A
antpv2018-08-03 18:12:15
JavaScript
antpv, 2018-08-03 18:12:15

How to make a minimal webpack build?

  1. I write: npm -g install webpack
  2. In the webpack.config.js file, I write an object for a minimal build
  3. I write in npm: webpack , the following error appears:
    One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
    - webpack-cli ( https://github.com/webpack/webpack-cli)
    The original webpack full-featured CLI.
    - webpack-command ( https://github.com/webpack-contrib/webpack-command)
    A lightweight, opinionated webpack CLI.
    We will use "npm" to install the CLI via "npm install -D".
    Which one do you like to install (webpack-cli/webpack-command):

  4. I write: webpack-cli , after which npm initializes the installation, however this does not solve the problem, when the webpack command is repeated, the same error occurs.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SagePtr, 2018-08-03
@SagePtr

npm -g install webpack-cli

I
ilimi, 2020-04-09
@ilimi

In a fresh webpack, you should write in the console not just webpack , but as follows:
npx webpack

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question