问答详情
源自:2-1 vue-loader+webpack项目配置

还是要装webpack-cli吗

视频中并没有安装webpack-cli,老师也说不要自己配么?为什么我还报错,一定要让我装webpack-cli呢

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):


提问者:慕莱坞02534 2018-07-24 18:19

个回答

  • Peanut_JY
    2018-07-25 11:03:04
    已采纳

    webpack 4 需要安装webpack-cli

  • 上官血浪
    2018-11-04 18:14:28

    安装后还报错。

    WARNING in configuration

    The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.

    You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/


    ERROR in ./src/app.vue 1:0

    Module parse failed: Unexpected token (1:0)

    You may need an appropriate loader to handle this file type.

    > <template>

    |     <div id="text">{{text}}</div>

    | </template>

     @ ./src/index.js 2:0-27 8:19-22