提交 09b564fe 编写于 作者: fxy060608's avatar fxy060608

fix(app-plus): remove css comments

上级 cedeedc7
......@@ -8,6 +8,11 @@ const trim_1 = __importDefault(require("./stylePlugins/trim"));
const scoped_1 = __importDefault(require("./stylePlugins/scoped"));
const styleProcessors_1 = require("./styleProcessors");
const removeScoped_1 = __importDefault(require("./stylePlugins/remove-scoped"));
let comments;
try{
comments = require('postcss-discard-comments')
}catch(e){}
function compileStyle(options) {
return doCompileStyle(Object.assign({}, options, { isAsync: false }));
}
......@@ -31,6 +36,12 @@ function doCompileStyle(options) {
} else { // fixed by xxxxxx
plugins.push(removeScoped_1.default(id));
}
// fixed by xxxxxx
if (process.env.UNI_PLATFORM === 'app-plus' && process.env.NODE_ENV === 'production') {
if (comments) {
plugins.push(comments);
}
}
const postCSSOptions = Object.assign({}, postcssOptions, { to: filename, from: filename });
if (map) {
postCSSOptions.map = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册