其他分享
首页 > 其他分享> > Webpack中的sourceMap配置

Webpack中的sourceMap配置

作者:互联网

---------------------------------------webpack.config.js----------------------------------------------------------
module.exports = {

mode:'development',

// 开发环境 development
// devtool:'cheap-module-eval-source-map',

// 生产环境 production
// devtool:'cheap-module-source-map',


devtool:'cheap-module-eval-source-map',
entry: {
main: './src/index.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname,'dist')
},
plugins:[new HtmlWebpackPlugin({
template:'src/index.html'
}),new CleanWebpackPlugin(['dist'])],
module: {
rules: [
{
test: /\.jpg$/, //这个配置是重点
use: {
loader:"file-loader",
options:{
name:'[name].[ext]', //打包出来的图片名字和后缀都和之前的一样,
outputPath:"images/" //打包出来的文件存放在dist/images文件夹中
}
}
},

]
}
};
------------------注释--------------------------

标签:map,dist,配置,cheap,sourceMap,module,source,Webpack,eval
来源: https://www.cnblogs.com/hellosxs/p/11412152.html