Authored by shijian

postcss缺少一些插件

... ... @@ -39,7 +39,14 @@
"moment": "^2.14.1",
"morgan": "^1.7.0",
"oneapm": "^1.2.20",
"postcss-calc": "^5.3.1",
"postcss-center": "^1.0.0",
"postcss-clearfix": "^1.0.0",
"postcss-crip": "^2.0.1",
"postcss-import": "^10.0.0",
"postcss-position": "^0.5.0",
"postcss-short": "^1.4.0",
"postcss-use": "^2.3.0",
"request-promise": "^3.0.0",
"scss-loader": "0.0.1",
"serve-favicon": "^2.3.0",
... ...
... ... @@ -5,7 +5,7 @@ const devInfo = require('./public/build/dev-info.js');
let assets, sprites;
if (process.env.NODE_ENV === 'production' || 'performance') {
if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'performance') {
assets = {
loadPaths: [path.join(__dirname, './public/img/'), path.join(__dirname, './public/font/')],
basePath: path.join(__dirname, './public/'),
... ... @@ -62,6 +62,7 @@ module.exports = {
},
'postcss-assets': assets,
'postcss-sprites': sprites,
'postcss-calc': {},
'postcss-pxtorem': {
rootValue: 40,
unitPrecision: 5, // 保留5位小数字
... ... @@ -69,6 +70,9 @@ module.exports = {
selectorBlackList: [], // 选择器黑名单,可以使用正则
propWhiteList: [] // 属性名称为空,表示替换所有属性的值
},
'postcss-use': {
modules: ['postcss-clearfix', 'postcss-crip', 'postcss-short', 'postcss-center', 'postcss-position']
},
autoprefixer: {
browsers: ['> 1%', 'android >=4', 'ios >=8']
}
... ...