三体XRaindrop
2018-06-01 20:41
> todolist@1.0.0 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! todolist@1.0.0 build: `webpack --config webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the todolist@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\Tom\AppData\Roaming\npm-cache\_logs\2018-06-01T12_35_36_148Z-debug.log
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()
]
npm install style-loader css-loader -D
然后,将
{
test: /\.css$/,
use:[
'style-loader',
'css-loader',
]
},
添加到webpack中的,module中试试
Vue+Webpack打造todo应用
84606 学习 · 787 问题
相似问题
回答 2
回答 1
回答 7
回答 1
回答 3