const px2rem = require('postcss-px2rem') const path = require('path') const postcss = px2rem({ remUnit: 20 //基准大小 baseSize,需要和rem.js中相同 }); module.exports = { publicPath: './', productionSourceMap: false, configureWebpack: config => { config.externals = { BMap: "BMap" } config.resolve.modules = [path.resolve('node_modules'), 'node_modules']; }, css: { loaderOptions: { css: {}, postcss: { plugins: [ postcss ] } } }, devServer: { https: false, disableHostCheck: true, }, chainWebpack: (config) => { config.module.rule('swf') .test(/\.swf/) .use('url-loader') .loader('url-loader') .options({ limit: 10000 }) }, }