Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

webpack.config.js

module:{
    rules:[
        {
            test:/.(jpg|gif|png|jpeg)/,
            loader:'url-loader?name=image/[hash:10].[ext]'
        }
    ]
}

求解加上.[ext]的作用是什么


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
587 views
Welcome To Ask or Share your Answers For Others

1 Answer

这是通过 name 字段来指定图片打包的目录与文件名:

image/[hash:10].[ext]

image/10位hash值.文件后缀名


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...