Skip to content

Commit

Permalink
fix: pxtransform disable on quick-app
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode authored and luckyadam committed Dec 26, 2019
1 parent af14d8f commit 3eecc2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/taro-mini-runner/src/webpack/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export const getModule = (appPath: string, {
{
ident: 'postcss',
plugins: getPostcssPlugins(appPath, {
isQuickapp,
designWidth,
deviceRatio,
postcssOption
Expand Down
3 changes: 2 additions & 1 deletion packages/taro-mini-runner/src/webpack/postcss.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
}

Expand Down

0 comments on commit 3eecc2f

Please sign in to comment.