|
@@ -63,7 +63,7 @@ function classNamePreContainer(): SourceCodeTransformer {
|
|
|
return id.includes('__uno.css') || id.includes('app.wxss')
|
|
return id.includes('__uno.css') || id.includes('app.wxss')
|
|
|
},
|
|
},
|
|
|
async transform(code, id, { uno }) {
|
|
async transform(code, id, { uno }) {
|
|
|
- code.replace(/(\.(?:(?!container).+))\{/g, '.container $1{')
|
|
|
|
|
|
|
+ code.replace(/(\.(?:(?!container).+))\{/g, '.container$1,.container $1{')
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -92,6 +92,7 @@ export default defineConfig({
|
|
|
* @see https://github.com/unocss/unocss#shortcuts
|
|
* @see https://github.com/unocss/unocss#shortcuts
|
|
|
*/
|
|
*/
|
|
|
shortcuts: [['center', 'flex justify-center items-center']],
|
|
shortcuts: [['center', 'flex justify-center items-center']],
|
|
|
|
|
+ // 仅h5有效, 编译、打包小程序不会触发
|
|
|
transformers: [
|
|
transformers: [
|
|
|
classNamePreContainer(),
|
|
classNamePreContainer(),
|
|
|
optimization(),
|
|
optimization(),
|