Authored by 毕凯

完善打包

No preview for this file type
This diff could not be displayed because it is too large.
... ... @@ -51,6 +51,7 @@ function postcssEnvPlugin(env) {
var group = file.url.split('/')[1];
file.retina = true; // H5 强制所有图片都是用二倍图
file.radio = 2; // H5 强制所有图片都是用二倍图
return group ? Promise.resolve(group) : Promise.reject();
},
filterBy: function(file) {
... ... @@ -95,7 +96,7 @@ function postcssEnvPlugin(env) {
});
}
return [
const plugins = [
require('precss'),
require('postcss-assets')(assets),
require('postcss-sprites').default(sprites),
... ... @@ -116,6 +117,15 @@ function postcssEnvPlugin(env) {
modules: ['postcss-clearfix', 'postcss-crip', 'postcss-short', 'postcss-center', 'postcss-position']
})
];
if (env === 'PRO') {
plugins.push(require('postcss-cachebuster')({
imagesPath: `/${distDir.img}`,
cssPath: `/${distDir.css}`
}));
}
return plugins;
}
//Postcss开发环境
... ...