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

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

啟動報錯You may need an appropriate loader to handle this file type. 都已經加載了

const?path?=?require('path')
const??{?VueLoaderPlugin?}??=?require('vue-loader')
const?HTMLPlugin?=?require('html-webpack-plugin')
const?webpack?=?require('webpack')

const?isDev?=?process.env.NODE_ENV?===?'development'

const?config?=?{
????target:?'web',
????entry:?path.join(__dirname,?'src/index.js'),
????output:?{
????????filename:?'bundle.js',
????????path:?path.join(__dirname,?'dist')
????},
????module:{
????????rules:?[
????????????{
??????????????test:?/\.vue$/,
??????????????use:?[
??????????????????{loader:?'vue-loader'}
??????????????]
????????????},

????????]
????},
????plugins:?[
????????new?VueLoaderPlugin(),
????????new?webpack.DefinePlugin({
????????????'process.env':?{
????????????????NODE_ENV:?isDev???'"development"'?:?'"production"'
????????????}
????????}),
????????new?HTMLPlugin()

????]
}

if(isDev){
??config.devServer?=?{
??????port:?8000,
??????host:?'0.0.0.0',
??????overlay:?{
??????????errors:?true
??????},
??????open:?true
??}
}

module.export?=?config


正在回答

3 回答

你的報錯應該是css內容無法解析吧,15版的?vue-loader?會出現這種情況,你還需要把
{
????test;?/\.css$/,
????loader:?'css-loader'
}
也加入到?rules?數組里面。


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

方法一: 把vue-loader版本替換為14

方法二: 根據vue-loader官方提供的15版本的聲明方法,定義plugin。

const?VueLoaderPlugin?=?require('vue-loader/lib/plugin')??
module.exports?=?{
??module:?{
????rules:?[
??????//?...?other?rules
??????{
????????test:?/\.vue$/,
????????loader:?'vue-loader'
??????}
????]
??},
??plugins:?[
????new?VueLoaderPlugin()???//15版本需指定plugin
??]}


4 回復 有任何疑惑可以回復我~
#1

主打情歌

這個是正解
2018-12-05 回復 有任何疑惑可以回復我~

把vue-loader的版本替換成^14.2.0試一下

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

舉報

0/150
提交
取消

啟動報錯You may need an appropriate loader to handle this file type. 都已經加載了

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

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

幫助反饋 APP下載

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

公眾號

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