第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

照著編碼,會(huì)報(bào)這個(gè)錯(cuò)誤,怎么解決呢?

http://img1.sycdn.imooc.com//600d9ca00001c5d824041102.jpg打包出錯(cuò)了

正在回答

5 回答

rules中增加以下規(guī)則:

{

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

? ? ? ? ? ? ? ? use: ['style-loader', 'css-loader']

? ? ? ? ? ? },//配置處理.css文件的第三方處理規(guī)則

然后去github里對(duì)應(yīng)webpack版本下載安裝對(duì)應(yīng)的css-loader、style-loader版本依賴

我的依賴版本如下,可以作為參考:

? ? "css-loader": "^6.7.1",

? ? "style-loader": "^3.1.0",

? ? "vue": "^2.6.10",

? ? "vue-loader": "^15.7.0",

? ? "vue-template-compiler": "^2.6.10",

? ? "webpack": "^5.73.0"

0 回復(fù) 有任何疑惑可以回復(fù)我~
const?path?=?require('path')const?VueLoaderPlugin?=?require('vue-loader/lib/plugin')const?htmlWebpackplugin?=?require('html-webpack-plugin');module.exports?=?{entry:?path.join(__dirname,?'src/index.js'),output:?{filename:?'bundle.js',path:?path.join(__dirname,?"dist")},module:?{rules:?[//?{//?????test:?/\.(vue|js|jsx)$/,//?????loader:?'eslint-loader',//?????exclude:?/node_modules/,//?????enforce:?'pre'//?},{test:?/\.vue$/,loader:?'vue-loader'},{test:?/\.css$/,loader:?'css-loader'},{test:?/\.styl/,use:?['style-loader','css-loader','stylus-loader']}]},plugins:?[new?htmlWebpackplugin({}),new?VueLoaderPlugin()],mode:?'development'}


1 回復(fù) 有任何疑惑可以回復(fù)我~

謝謝樓主!照你的方法 生成dist了。

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

慕移動(dòng)9059126

生成 dist 之后可以運(yùn)行嗎?為啥我的生成dist了還報(bào)錯(cuò)
2021-06-28 回復(fù) 有任何疑惑可以回復(fù)我~

這個(gè)我解決了,webpack版本過(guò)高的話需要安裝html-webpack-plugin和vue-loader-plugin插件,然后webpack.config.js的配置如下:

const path = require('path')

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

const htmlWebpackplugin = require('html-webpack-plugin');

module.exports = {

entry:path.join(__dirname,'src/index.js'),

output:{

filename:'bundle.js',

path:path.join(__dirname,'dist')

},

module:{

rules:[

{

test:/\.vue$/,

loader:'vue-loader'

},

{

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

? ? ? ? loader: 'css-loader'

? ? ? ? },

? ? ? ? {

? ? ? ? test:/\.styl/,

? ? ? ? use:[

? ? ? ? ? 'style-loader',

? ? ? ? ? 'css-loader',

? ? ? ? ? 'stylus-loader'

? ? ? ? ]

? ? ? ? },

? ? ? ? {

? ? ? ? test:/\.(gif|jpg|jpeg|png|svg)$/,

? ? ? ? use:[

? ? ? ? ? ? {

? ? ? ? ? loader:'url-loader',

? ? ? ? ? ? options:{

? ? ? ? ? ? limit:1024,

? ? ? ? ? ? name:'[name]-aaa.[ext ]'

? ? ? ? ? ? }

? ? ? ? ? ? }

? ? ? ? ??

? ? ? ? ]

? ? ? ? }

]

},

plugins: [

? ? ? ? new htmlWebpackplugin({

? ? ? ? }),

? ? ? ? new VueLoaderPlugin()

? ? ],

}


5 回復(fù) 有任何疑惑可以回復(fù)我~

我也是這個(gè)問(wèn)題

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

照著編碼,會(huì)報(bào)這個(gè)錯(cuò)誤,怎么解決呢?

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)