From e74f0fbda417ba3a2861ff3c8a54dea483454565 Mon Sep 17 00:00:00 2001 From: qiang Date: Wed, 10 Aug 2022 21:03:58 +0800 Subject: [PATCH] fix: postcss-comment --- template/common/postcss.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/template/common/postcss.config.js b/template/common/postcss.config.js index e149b58..c4a965e 100644 --- a/template/common/postcss.config.js +++ b/template/common/postcss.config.js @@ -1,6 +1,7 @@ const path = require('path') const webpack = require('webpack') const config = { + parser: require('postcss-comment'), plugins: [ require('postcss-import')({ resolve (id, basedir, importOptions) { @@ -20,7 +21,7 @@ const config = { require('@dcloudio/vue-cli-plugin-uni/packages/postcss') ] } -if (webpack.version[0] <= 4) { - options.parser = require('postcss-comment') +if (webpack.version[0] > 4) { + delete config.parser } module.exports = config