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

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

image-webpack-loader 在webpack2中使用出錯(cuò)

image-webpack-loader 在webpack2中使用出錯(cuò)

正在回答

10 回答

Configure optipng's optimizationLevel option in its own options ,這里是說(shuō)如果你要壓縮圖片,針對(duì)某一類型的,你需要單獨(dú)的放到他的options里,{

????optipng: {

????????optimizationLevel: xxx

????}

}

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

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

? ? ? ? ? ? ? loaders: [

? ? ? ? ? ? ? ? ? 'url-loader?limit=1000&name=images/[name]-[hash:5].[ext]!image-webpack'

? ? ? ? ? ? ? ]


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

你們用的是mac或者 ubuntu么,在這兩個(gè)環(huán)境下要安裝libpng?

mac: brew install libpng

ubuntu:apt-get install libpng


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

慕桂英5446361

謝謝 是不是 沒(méi)有l(wèi)ibpng 就不能正常運(yùn)行。
2017-07-14 回復(fù) 有任何疑惑可以回復(fù)我~

我是這樣配置的

{
? ?test: /\.(png|jpg|gif|svg)$/i,
? ?use: ['url-loader?limit=1000&name=images/[name]-[hash:5].[ext]','image-webpack-loader']
}


報(bào)錯(cuò)是這樣:

ERROR in ./images/ico_arrowB.png

Module build failed: TypeError: Cannot read property 'bypassOnDebug' of null

? ? at Object.module.exports (C:\Users\Administrator\Desktop\cal\node_modules\image-webpack-loader\index.js:30:26)

?@ ./~/css-loader!./~/autoprefixer-loader!./css/common.css 6:3955-3990

?@ ./css/common.css

?@ ./script/jquery-1.11.3.mini.js

?@ multi ./script/user_calendar.js ./script/common.js ./laydate/laydate.js ./script/sweetalert.min.js ./script/jquery.se

archableSelect.js ./script/jquery-1.11.3.mini.js


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

先安裝img-loader : ?

npm?install?img-loader?--save-dev

然后在webpack.config.js中配置:

{
?????test:?/\.(png|jpg|gif|svg)$/i,
?????use:?[
???????{
???????loader:?'url-loader',
???????options:?{
?????????limit:?10000,
?????????name:?'assets/[name]-[hash:5].[ext]'
???????}
???????},
???????{
???????loader:?'img-loader'
???????}
?????]
}


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

為何 會(huì)出現(xiàn)警告呢。。。。webpack2 ?按照 ?image-webpack-loader ?的寫(xiě)的 ? 那個(gè)大神幫忙看看

WARNING in ./src/images/chosen.png

(Emitted value instead of an instance of Error) DEPRECATED. Configure gifsicle's interlaced option in its own options. (gifsicle.interlaced)

?@ ./~/.0.28.0@css-loader!./~/._postcss-loader@1.3.3@postcss-loader?{}!./~/._less-loader@4.0.3@less-loader/dist!./src/components/layer/layer.less 6:192-226

?@ ./src/components/layer/layer.less

?@ ./src/components/layer/layer.js

?@ ./src/app.js


WARNING in ./src/images/chosen.png

(Emitted value instead of an instance of Error) DEPRECATED. Configure optipng's optimizationLevel option in its own options. (optipng.optimizationLevel)

?@ ./~/.0.28.0@css-loader!./~/._postcss-loader@1.3.3@postcss-loader?{}!./~/._less-loader@4.0.3@less-loader/dist!./src/components/layer/layer.less 6:192-226

?@ ./src/components/layer/layer.less

?@ ./src/components/layer/layer.js

?@ ./src/app.js


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

weibo_忽如一夜爆星辰_0

我也遇到了,你可解決?
2017-06-15 回復(fù) 有任何疑惑可以回復(fù)我~
#2

慕粉201919995

我也碰到了這個(gè)報(bào)錯(cuò) 不知道該怎么解決
2017-06-22 回復(fù) 有任何疑惑可以回復(fù)我~
#3

Chyrain

看錯(cuò)誤提示!應(yīng)該是在options里配置,把interlaced放到gifsicle里,optimizationLevel放到optipng里,類似這樣: { loader: 'image-webpack-loader', options: { optipng: { optimizationLevel: 7 }, gifsicle:{ interlaced: false }, pngquant: { quality: '65-90', speed: 4, }, mozjpeg: { quality: 65 } } }
2017-12-01 回復(fù) 有任何疑惑可以回復(fù)我~
#4

qbaty

Chyrain說(shuō)的是對(duì)的
2017-12-29 回復(fù) 有任何疑惑可以回復(fù)我~
查看1條回復(fù)

loaders: [
?{
? ?test: /\.(gif|png|jpe?g|svg)$/i,
? ?loaders: [ ? ? ?'file-loader',
? ? ?{
? ? ? ?loader: 'image-webpack-loader',
? ? ? ?query: {
? ? ? ? ?progressive: true,
? ? ? ? ?optimizationLevel: 7,
? ? ? ? ?interlaced: false,
? ? ? ? ?pngquant: {
? ? ? ? ? ?quality: '65-90',
? ? ? ? ? ?speed: 4
? ? ? ? ?}
? ? ? ?}
? ? ?}
? ?]
?}
]
https://github.com/tcoopman/image-webpack-loader

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

?{

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

????????????????loaders:?[

????????????????????'url-loader?limit=4000&name=[name]-[hash:5].[ext]',

????????????????????'image-webpack-loader'

????????????????]

????????????}?

webpack2 不能將loader省略,應(yīng)完整寫(xiě)出: 'image-webpack-loader'


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

use:[

{

loader:'url-loader?limit=20000&name=assets/[name]-[hash:5].[ext]!image-webpack'

}

]


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

我自己換成了webpack2的配置如下:

{

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

use: [

{

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

options: {

name: 'assets/[name]-[hash:5].[ext]',

limit: 4000 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??

}

},

'image-webpack-loader' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

] ? ? ? ? ? ? ? ? ? ? ??

}


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

SoooHy

為什么我這么寫(xiě)依然報(bào)錯(cuò)= =
2017-03-17 回復(fù) 有任何疑惑可以回復(fù)我~
#2

慕粉1831401519

我寫(xiě)的完整的'image-webpack-loader'也報(bào)錯(cuò),換成img-loader就沒(méi)問(wèn)題
2017-03-31 回復(fù) 有任何疑惑可以回復(fù)我~
#3

阿亮007 回復(fù) 慕粉1831401519

我換成img-loader 也報(bào)錯(cuò)
2017-04-04 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

image-webpack-loader 在webpack2中使用出錯(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)