diff --git a/package.json b/package.json index 929e84a..b842cfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dcasia/mini-program-tailwind-webpack-plugin", - "version": "1.5.1", + "version": "1.5.3", "description": "让你的小程序用上原汁原味的 Tailwind/Windi CSS", "keywords": [ "mini-program", diff --git a/src/postcss/index.ts b/src/postcss/index.ts index a657b9d..5f72083 100644 --- a/src/postcss/index.ts +++ b/src/postcss/index.ts @@ -24,7 +24,7 @@ export function transformSelector(options: Options) { customReplacement.set(/^(\.-?space-\w-reverse).*/, spaceBetweenItems.map(item => `$1>${ item }:not([hidden])`).join(', ')) customReplacement.set(/^(\.-?divide-\w+)(-.+?)?\s?>.*/, divideItems.map(item => `$1$2:not($1-reverse)>${ item }:not([hidden]):not(:first-child), $1$2$1-reverse>${ item }:not([hidden]):not(:last-child)`).join(', ')) customReplacement.set(/^(\.-?divide-\w-reverse).*/, divideItems.map(item => `$1>${ item }:not([hidden])`).join(', ')) - customReplacement.set('*', allComponents.join(', ')) + customReplacement.set(/(\*$|\*(?=,))/, allComponents.join(', ')) return { postcssPlugin: 'transformSelectorName', diff --git a/src/utilities.ts b/src/utilities.ts index 6e49878..0684e09 100644 --- a/src/utilities.ts +++ b/src/utilities.ts @@ -32,6 +32,7 @@ const charactersMap = { ':': '-c-', ',': '-2c-', '%': '-p-', + '\'': '-q-', } const specialCharactersMap = {