From 5f4bba65fac81e7600949803046f7ad95408e76f Mon Sep 17 00:00:00 2001 From: zuofenghua <11100776@bbktel.com> Date: Tue, 7 Sep 2021 20:19:37 +0800 Subject: [PATCH] fix: #14 --- package.json | 5 ++-- src/index.ts | 3 +++ tsconfig.json | 2 +- yarn.lock | 67 ++++++++++++++++++++++++++++----------------------- 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 8034137..8957235 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umi-plugin-tailwindcss", - "version": "3.1.5", + "version": "3.2.1", "description": "umi@3.0 plugin for tailwindcss", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -34,7 +34,8 @@ "access": "public" }, "dependencies": { - "@tailwindcss/postcss7-compat": "latest" + "@tailwindcss/postcss7-compat": "latest", + "autoprefixer": "9.x" }, "devDependencies": { "@rollup/plugin-node-resolve": "^7.1.1", diff --git a/src/index.ts b/src/index.ts index 2c3f6a8..e51ae91 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,9 +40,12 @@ export default (api: IApi) => { ? 'tailwindcss' : '@tailwindcss/postcss7-compat'; + const autoprefixerOptions = api.userConfig.autoprefixer; + config.extraPostCSSPlugins = [ ...(config.extraPostCSSPlugins || []), require(tailwindcssPackageName)({ config: configPath }), + require('autoprefixer')(autoprefixerOptions), ]; return config; diff --git a/tsconfig.json b/tsconfig.json index ad0eb54..a2c900f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,4 +19,4 @@ "include": [ "src" ] -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 874fe80..35ba41a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1324,30 +1324,30 @@ dependencies: defer-to-connect "^1.0.1" -"@tailwindcss/postcss7-compat@^2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@tailwindcss/postcss7-compat/-/postcss7-compat-2.2.7.tgz#5e7e436ed0f4e0ed945d35b1f87189daa681dd1f" - integrity sha512-1QkWUEeLV1AoNipMCE6IlL7XYScGb+DAzaXy35ooMDvl0G8kCMHBNqGxyVAnTcK8gyJNUzkKXExkUnbjAndd/g== +"@tailwindcss/postcss7-compat@latest": + version "2.2.10" + resolved "https://registry.yarnpkg.com/@tailwindcss/postcss7-compat/-/postcss7-compat-2.2.10.tgz#a84da77fb45e80b638419d25963814724129880d" + integrity sha512-mAINjdThr/MtFmYw1aXX7lCskd2W4v8cySFviQT4tcYG4BofCewP7wp3c2WghAwAf4Ox9ZKU4pV4YeS6YU/7kg== dependencies: - arg "^5.0.0" + arg "^5.0.1" autoprefixer "^9" bytes "^3.0.0" - chalk "^4.1.1" + chalk "^4.1.2" chokidar "^3.5.2" - color "^3.2.0" - cosmiconfig "^7.0.0" + color "^4.0.1" + cosmiconfig "^7.0.1" detective "^5.2.0" didyoumean "^1.2.2" dlv "^1.1.3" fast-glob "^3.2.7" fs-extra "^10.0.0" - glob-parent "^6.0.0" + glob-parent "^6.0.1" html-tags "^3.1.0" is-glob "^4.0.1" lodash "^4.17.21" lodash.topath "^4.5.2" modern-normalize "^1.1.0" - node-emoji "^1.8.1" + node-emoji "^1.11.0" normalize-path "^3.0.0" object-hash "^2.2.0" postcss "^7" @@ -2350,10 +2350,10 @@ arch@^2.1.1: resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e" integrity sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg== -arg@^5.0.0: +arg@^5.0.1: version "5.0.1" - resolved "http://npm.vivo.com.cn/arg/-/arg-5.0.1.tgz#eb0c9a8f77786cad2af8ff2b862899842d7b6adb" - integrity sha1-6wyaj3d4bK0q+P8rhiiZhC17ats= + resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.1.tgz#eb0c9a8f77786cad2af8ff2b862899842d7b6adb" + integrity sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA== argparse@^1.0.7: version "1.0.10" @@ -2465,7 +2465,7 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -autoprefixer@^9: +autoprefixer@9.x, autoprefixer@^9: version "9.8.6" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.6.tgz#3b73594ca1bf9266320c5acf1588d74dea74210f" integrity sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg== @@ -2951,10 +2951,10 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.1.1: +chalk@^4.1.2: version "4.1.2" - resolved "http://npm.vivo.com.cn/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha1-qsTit3NKdAhnrrFr8CqtVWoeegE= + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -3125,7 +3125,7 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0, color-convert@^1.9.1, color-convert@^1.9.3: +color-convert@^1.9.0, color-convert@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -3173,12 +3173,12 @@ color@3.1.2, color@^3.0.0: color-convert "^1.9.1" color-string "^1.5.2" -color@^3.2.0: - version "3.2.1" - resolved "http://npm.vivo.com.cn/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" - integrity sha1-NUTcGYyvRJDD7MmnkLVP6f9F4WQ= +color@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/color/-/color-4.0.1.tgz#21df44cd10245a91b1ccf5ba031609b0e10e7d67" + integrity sha512-rpZjOKN5O7naJxkH2Rx1sZzzBgaiWECc6BYXjeCE6kF0kcASJYbUq02u7JqIHwCb/j3NhV+QhRL2683aICeGZA== dependencies: - color-convert "^1.9.3" + color-convert "^2.0.1" color-string "^1.6.0" colorette@^1.2.1: @@ -3360,10 +3360,10 @@ cosmiconfig@^5.0.0, cosmiconfig@^5.2.1: js-yaml "^3.13.1" parse-json "^4.0.0" -cosmiconfig@^7.0.0: +cosmiconfig@^7.0.1: version "7.0.1" - resolved "http://npm.vivo.com.cn/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" - integrity sha1-cU11ZSLKzoZ4Z8y0R0xdAbuuXW0= + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" + integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== dependencies: "@types/parse-json" "^4.0.0" import-fresh "^3.2.1" @@ -4616,10 +4616,10 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^6.0.0: +glob-parent@^6.0.1: version "6.0.1" - resolved "http://npm.vivo.com.cn/glob-parent/-/glob-parent-6.0.1.tgz#42054f685eb6a44e7a7d189a96efa40a54971aa7" - integrity sha1-QgVPaF62pE56fRialu+kClSXGqc= + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.1.tgz#42054f685eb6a44e7a7d189a96efa40a54971aa7" + integrity sha512-kEVjS71mQazDBHKcsq4E9u/vUzaLcw1A8EtUeydawvIWQCJM0qQ08G1H7/XTjFUulla6XQiDOG6MXSaG0HDKog== dependencies: is-glob "^4.0.1" @@ -6137,13 +6137,20 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-emoji@^1.10.0, node-emoji@^1.8.1: +node-emoji@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.10.0.tgz#8886abd25d9c7bb61802a658523d1f8d2a89b2da" integrity sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw== dependencies: lodash.toarray "^4.4.0" +node-emoji@^1.11.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c" + integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A== + dependencies: + lodash "^4.17.21" + node-libs-browser@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425"