diff --git a/dotcom-rendering/.gitignore b/dotcom-rendering/.gitignore index 0975586c5f1..8211ed94307 100644 --- a/dotcom-rendering/.gitignore +++ b/dotcom-rendering/.gitignore @@ -4,3 +4,6 @@ tsconfig.tsbuildinfo # CDK asset staging directory .cdk.staging cdk.out + +# SWC cache +.swc diff --git a/dotcom-rendering/package.json b/dotcom-rendering/package.json index f014416c28b..64eb3929c64 100644 --- a/dotcom-rendering/package.json +++ b/dotcom-rendering/package.json @@ -56,6 +56,7 @@ "@swc/cli": "0.8.1", "@swc/core": "1.15.41", "@swc/jest": "0.2.39", + "@swc/plugin-emotion": "14.12.0", "@testing-library/dom": "10.4.1", "@testing-library/jest-dom": "6.9.1", "@testing-library/react": "16.3.0", diff --git a/dotcom-rendering/src/components/LiveBlockContainer.tsx b/dotcom-rendering/src/components/LiveBlockContainer.tsx index 4a47fb3de6e..ed969fafba3 100644 --- a/dotcom-rendering/src/components/LiveBlockContainer.tsx +++ b/dotcom-rendering/src/components/LiveBlockContainer.tsx @@ -110,7 +110,7 @@ const BlockByline = ({ ); }; -const liveBlockContainerStyles = () => css` +const liveBlockContainerStyles = css` padding: ${space[2]}px ${SIDE_MARGIN_MOBILE}px; box-sizing: border-box; margin-bottom: ${space[3]}px; diff --git a/dotcom-rendering/webpack/.swcrc.json b/dotcom-rendering/webpack/.swcrc.json index 51f3d35ea92..490d70a5893 100644 --- a/dotcom-rendering/webpack/.swcrc.json +++ b/dotcom-rendering/webpack/.swcrc.json @@ -12,6 +12,9 @@ "runtime": "automatic", "importSource": "@emotion/react" } + }, + "experimental": { + "plugins": [["@swc/plugin-emotion", {}]] } }, "sourceMaps": true diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a9ac7a34ac4..6413c14e956 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -398,6 +398,9 @@ importers: '@swc/jest': specifier: 0.2.39 version: 0.2.39(@swc/core@1.15.41) + '@swc/plugin-emotion': + specifier: 14.12.0 + version: 14.12.0 '@testing-library/dom': specifier: 10.4.1 version: 10.4.1 @@ -3988,6 +3991,9 @@ packages: peerDependencies: '@swc/core': '*' + '@swc/plugin-emotion@14.12.0': + resolution: {integrity: sha512-lyAQgTeDkowq/4+8JYaviVOL4jXSdObz+uuk84DjM0z4qoiMpI6xoDVp7/tjWeVjmLc2U6Qp3hDuwWMZ5xe88Q==} + '@swc/types@0.1.26': resolution: {integrity: sha512-lyMwd7WGgG79RS7EERZV3T8wMdmPq3xwyg+1nmAM64kIhx5yl+juO2PYIHb7vTiPgPCj8LYjsNV2T5wiQHUEaw==} @@ -13597,6 +13603,10 @@ snapshots: '@swc/counter': 0.1.3 jsonc-parser: 3.2.0 + '@swc/plugin-emotion@14.12.0': + dependencies: + '@swc/counter': 0.1.3 + '@swc/types@0.1.26': dependencies: '@swc/counter': 0.1.3