Skip to content

Commit cd24a67

Browse files
committed
fix: postCss 支持绝对路径插件
1 parent 4e186a3 commit cd24a67

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/taro-webpack5-runner/src/postcss/postcss.h5.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const getPostcssPlugins = function (appPath: string, option: [string, Tog
8989

9090
if (!isNpmPkg(pluginName)) {
9191
// local plugin
92-
pluginName = path.join(appPath, pluginName)
92+
pluginName = path.isAbsolute(pluginName) ? pluginName : path.join(appPath, pluginName)
9393
}
9494

9595
try {

packages/taro-webpack5-runner/src/postcss/postcss.harmony.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const getPostcssPlugins = function (appPath: string, option: [string, Tog
8383

8484
if (!isNpmPkg(pluginName)) {
8585
// local plugin
86-
pluginName = path.join(appPath, pluginName)
86+
pluginName = path.isAbsolute(pluginName) ? pluginName : path.join(appPath, pluginName)
8787
}
8888

8989
try {

packages/taro-webpack5-runner/src/postcss/postcss.mini.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const getPostcssPlugins = function (appPath: string, option: [string, Tog
8282

8383
if (!isNpmPkg(pluginName)) {
8484
// local plugin
85-
pluginName = path.join(appPath, pluginName)
85+
pluginName = path.isAbsolute(pluginName) ? pluginName : path.join(appPath, pluginName)
8686
}
8787

8888
try {

0 commit comments

Comments
 (0)