diff --git a/packages/frontend/lib/rollup-plugin-unwind-css-module-class-name.ts b/packages/frontend/lib/rollup-plugin-unwind-css-module-class-name.ts index 98028f1496..225ad5f458 100644 --- a/packages/frontend/lib/rollup-plugin-unwind-css-module-class-name.ts +++ b/packages/frontend/lib/rollup-plugin-unwind-css-module-class-name.ts @@ -112,22 +112,38 @@ export function unwindCssModuleClassName(ast: estree.Node): void { }); }, }); - this.replace({ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: node.declarations[0].id.name, - }, - init: { - type: 'Identifier', - name: ident, - }, - }], - kind: 'const', + (walk as typeof estreeWalker.walk)(render.argument.body, { + enter(childNode) { + if (childNode.type !== 'MemberExpression') return; + if (childNode.object.type !== 'MemberExpression') return; + if (childNode.object.object.type !== 'Identifier') return; + if (childNode.object.object.name !== ctx.name) return; + if (childNode.object.property.type !== 'Identifier') return; + if (childNode.object.property.name !== key) return; + if (childNode.property.type !== 'Identifier') return; + console.error(`${key}.${childNode.property.name} is not a valid css module class name`); + this.replace({ + type: 'Literal', + value: null, + }); + }, }); } + this.replace({ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: node.declarations[0].id.name, + }, + init: { + type: 'Identifier', + name: ident, + }, + }], + kind: 'const', + }); }, }); } @@ -138,6 +154,7 @@ export default function pluginUnwindCssModuleClassName(): Plugin { name: 'UnwindCssModuleClassName', renderChunk(code, chunk): { code: string } { const ast = this.parse(code) as unknown as estree.Node; + console.log(`======= ${chunk.fileName} =======`); unwindCssModuleClassName(ast); return { code: generate(ast) }; }, diff --git a/packages/frontend/src/components/MkMediaList.vue b/packages/frontend/src/components/MkMediaList.vue index c52ce8a179..a0a2450054 100644 --- a/packages/frontend/src/components/MkMediaList.vue +++ b/packages/frontend/src/components/MkMediaList.vue @@ -8,7 +8,7 @@ $style.medias, count === 1 ? [$style.n1, { [$style.n116_9]: defaultStore.reactiveState.mediaListWithOneImageAppearance.value === '16_9', - [$style.n1_1]: defaultStore.reactiveState.mediaListWithOneImageAppearance.value === '1_1', + [$style.n11_1]: defaultStore.reactiveState.mediaListWithOneImageAppearance.value === '1_1', [$style.n12_3]: defaultStore.reactiveState.mediaListWithOneImageAppearance.value === '2_3', }] : count === 2 ? $style.n2 : count === 3 ? $style.n3 : count === 4 ? $style.n4 : $style.nMany, ]" diff --git a/packages/frontend/src/components/MkModal.vue b/packages/frontend/src/components/MkModal.vue index 28c7eeb0ed..b1438bd9fa 100644 --- a/packages/frontend/src/components/MkModal.vue +++ b/packages/frontend/src/components/MkModal.vue @@ -20,7 +20,7 @@ [$style.transition_send_enterFrom]: transitionName === 'send', }" :leaveToClass="{ - [$style.transition_modalPopup_leaveTo]: transitionName === 'modal-popup', + [$style.transition_modalDrawer_leaveTo]: transitionName === 'modal-drawer', [$style.transition_modalPopup_leaveTo]: transitionName === 'modal-popup', [$style.transition_modal_leaveTo]: transitionName === 'modal', [$style.transition_send_leaveTo]: transitionName === 'send', @@ -402,8 +402,8 @@ defineExpose({ transition: transform 0.2s cubic-bezier(0,.5,0,1) !important; } } -.transition_modal-drawer_enterFrom, -.transition_modal-drawer_leaveTo { +.transition_modalDrawer_enterFrom, +.transition_modalDrawer_leaveTo { > .bg { opacity: 0; }