加上outPath属性 module.exports = { module: { rules: [ { test: /\.png/, // use: 'file-loader' use: 'url-loader', options: { limit: 1, outputPath: '/img/' } } ] } } 加上cdn地址 在具体的下面加上这个参数,或者直接在output中加 module.exports = { output: { publicPath: 'http://zhangfeng.com', } }