diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index e276f58c8536..b4852fa565d7 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -249,6 +249,7 @@ export const getModule = (appPath: string, { { ident: 'postcss', plugins: getPostcssPlugins(appPath, { + isQuickapp, designWidth, deviceRatio, postcssOption diff --git a/packages/taro-mini-runner/src/webpack/postcss.conf.ts b/packages/taro-mini-runner/src/webpack/postcss.conf.ts index 4f682ea90cc5..80df8f124ee0 100644 --- a/packages/taro-mini-runner/src/webpack/postcss.conf.ts +++ b/packages/taro-mini-runner/src/webpack/postcss.conf.ts @@ -29,6 +29,7 @@ const optionsWithDefaults = ['autoprefixer', 'pxtransform', 'cssModules', 'url'] const plugins = [] as any[] export const getPostcssPlugins = function (appPath: string, { + isQuickapp = false, designWidth, deviceRatio, postcssOption = {} as IPostcssOption @@ -49,7 +50,7 @@ export const getPostcssPlugins = function (appPath: string, { plugins.push(autoprefixer(autoprefixerOption.config)) } - if (pxtransformOption.enable) { + if (pxtransformOption.enable && !isQuickapp) { plugins.push(pxtransform(pxtransformOption.config)) }