1 'use strict' 2 // 工具=> build/util.js 3 const utils = require('./utils') 4 // 配置=> build/config/index.js 5 const config = require('../config') 6 7 const isProduction = process.env.NODE_ENV === 'production' 8 const sourceMapEnabled = isProduction 9 ? config.build.productionSourceMap10 : config.dev.cssSourceMap11 12 13 //对象模块导出{} 14 module.exports = {15 loaders: utils.cssLoaders({16 sourceMap: sourceMapEnabled,17 extract: isProduction18 }),19 cssSourceMap: sourceMapEnabled,20 cacheBusting: config.dev.cacheBusting,21 transformToRequire: {22 video: ['src', 'poster'],23 source: 'src',24 img: 'src',25 image: 'xlink:href'26 }27 }