还是要装webpack-cli吗

来源:2-1 vue-loader+webpack项目配置

慕莱坞02534

2018-07-24 18:19

视频中并没有安装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):


写回答 关注

2回答

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

    webpack 4 需要安装webpack-cli

    慕莱坞025...

    非常感谢!

    2018-08-09 17:11:14

    共 1 条回复 >

  • 上官血浪
    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


Vue+Webpack打造todo应用

用前端最热门框架Vue+最火打包工具Webpack打造todo应用

84606 学习 · 787 问题

查看课程

相似问题