npm run build 报错,webpack.config.js 中loader也配置了,还是报错

来源:-

qq_水木_4

2018-07-14 11:49

e_webpack_todo222@1.0.0 build C:\Users\31521\Documents\HBuilderProjects\慕课网学习\vue_webpack_todo222

> webpack --config webpack.config.js


Hash: 58e147e8275c42f986c7

Version: webpack 2.1.0-beta.22

Time: 247ms

    Asset    Size  Chunks             Chunk Names

bundle.js  221 kB       0  [emitted]  main

   [3] ./src/app.vue 286 bytes {0} [built] [failed] [1 error]

   [5] ./src/index.js 186 bytes {0} [built]

    + 4 hidden modules


ERROR in ./src/app.vue

Module parse failed: C:\Users\31521\Documents\HBuilderProjects\慕课网学习\vue_webpack_todo222\src\app.vue Unexpected token (1:0)

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

| <template>

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

| </template>

 @ ./src/index.js 2:0-27

npm ERR! code ELIFECYCLE

npm ERR! errno 2

npm ERR! vue_webpack_todo222@1.0.0 build: `webpack --config webpack.config.js`

npm ERR! Exit status 2

npm ERR!

npm ERR! Failed at the vue_webpack_todo222@1.0.0 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\31521\AppData\Roaming\npm-cache\_logs\2018-07-14T03_48_09_176Z-debug.log


写回答 关注

2回答

  • 慕工程4549149
    2020-10-13 21:46:46

    错的 不行

  • qq_慕码人8411593
    2019-10-14 14:19:28

    试试这个呢 npm install vue-template-compiler

Vue+Webpack打造todo应用

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

84605 学习 · 787 问题

查看课程

相似问题