亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

npm run build


> [email protected] build E:\work\todoList

> webpack --config webpack.config.js


Hash: 22c25b28c8f11c65bec2

Version: webpack 4.10.2

Time: 1429ms

Built at: 2018-06-01 20:35:36

? ? Asset? ? ?Size? Chunks? ? ? ? ? ? ?Chunk Names

bundle.js? 243 KiB? ? main? [emitted]? main

Entrypoint main = bundle.js

[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {main} [built]

[./src/app.vue] 1.07 KiB {main} [built] [1 error]

[./src/app.vue?vue&type=script&lang=js] 90 bytes {main} [built] [1 error]

[./src/app.vue?vue&type=style&index=0&lang=css] 182 bytes {main} [built] [failed] [2 errors]

[./src/app.vue?vue&type=template&id=bced26ea] 168 bytes {main} [built] [failed] [2 errors][./src/index.js] 180 bytes {main} [built]

? ? + 5 hidden modules


ERROR in ./src/app.vue?vue&type=style&index=0&lang=css

Module parse failed: Unexpected character '#' (16:0)

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

|

|

| #test{

|? ?color: red;

| }

?@ ./src/app.vue 4:0-62

?@ ./src/index.js


ERROR in ./src/app.vue?vue&type=template&id=bced26ea

Module parse failed: Unexpected token (2:0)

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

|

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

|

?@ ./src/app.vue 1:0-81 11:2-8 12:2-17

?@ ./src/index.js


ERROR in ./src/app.vue

vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

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


ERROR in ./src/app.vue?vue&type=template&id=bced26ea

vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

?@ ./src/app.vue 1:0-81 11:2-8 12:2-17

?@ ./src/index.js


ERROR in ./src/app.vue?vue&type=script&lang=js

vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

?@ ./src/app.vue 2:0-54 3:0-49 3:0-49 10:2-8

?@ ./src/index.js


ERROR in ./src/app.vue?vue&type=style&index=0&lang=css

vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

?@ ./src/app.vue 4:0-62

?@ ./src/index.js

npm ERR! code ELIFECYCLE

npm ERR! errno 2

npm ERR! [email protected] build: `webpack --config webpack.config.js`

npm ERR! Exit status 2

npm ERR!

npm ERR! Failed at the [email protected] 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\Tom\AppData\Roaming\npm-cache\_logs\2018-06-01T12_35_36_148Z-debug.log


正在回答

2 回答

ERROR in ./src/app.vue

vue-loader was used without the corresponding plugin.?

只能解釋這句話的意思,缺少合適的plugin插件。說明你的vue-loader是15.x版本

三、vue-loader15 變化

https://vue-loader.vuejs.org/migrating.html#a-plugin-is-now-required

1、vue-loader14及之前:僅作為loader加載

module:{

?? ?rules:[

?? ?{

?? ??? ?test:/\.vue$/,

?? ??? ?loader:'vue-loader'

? ? }

】}

2、vue-loader15 同時還需要一個Plugin == loader+plugin [loader參照之前: 沒寫loader我報錯了]

const VueLoaderPlugin = require('vue-loader/lib/plugin')

?? ?plugins:[

?? ??? ?new VueLoaderPlugin()

?? ?]


0 回復 有任何疑惑可以回復我~


npm install?style-loader?css-loader -D

然后,將

????{

??????? test: /\.css$/,

??????? use:[

????????? 'style-loader',

????????? 'css-loader',

??????? ]

????? },

添加到webpack中的,module中試試


3 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
Vue+Webpack打造todo應用
  • 參與學習       84618    人
  • 解答問題       812    個

用前端最熱門框架Vue+最火打包工具Webpack打造todo應用

進入課程

npm run build

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號