赞
踩
npm install lib-flexible --S
npm install px2rem-loader -S
import 'lib-flexible/flexible'
在build文件中找到util.js,将px2rem-loader添加到cssLoaders中,如:
const px2remLoader = { loader: 'px2rem-loader', options: { remUnit: 37.5 // (以宽为375的设计稿为基准值) } } // generate loader string to be used with extract text plugin function generateLoaders (loader, loaderOptions) { const loaders = options.usePostCSS ? [cssLoader, postcssLoader, px2remLoader] : [cssLoader, px2remLoader] if (loader) { loaders.push({ loader: loader + '-loader', options: Object.assign({}, loaderOptions, { sourceMap: options.sourceMap }) }) } // Extract CSS when that option is specified // (which is the case during production build) if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, fallback: 'vue-style-loader' }) } else { return ['vue-style-loader'].concat(loaders) } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。