build: config emotion css prop

This commit is contained in:
rusconn
2022-04-01 09:17:06 +09:00
parent 127c359b5f
commit da187f04e7
5 changed files with 25 additions and 2 deletions

15
.babelrc Normal file
View File

@@ -0,0 +1,15 @@
// https://emotion.sh/docs/css-prop##babel-preset
{
"presets": [
[
"next/babel",
{
"preset-react": {
"runtime": "automatic",
"importSource": "@emotion/react"
}
}
]
],
"plugins": [["@emotion/babel-plugin"]]
}

View File

@@ -28,6 +28,7 @@
"react-dom": "17.0.2"
},
"devDependencies": {
"@emotion/babel-plugin": "^11.7.2",
"@types/node": "^16.11.45",
"@types/react": "17.0.41",
"@typescript-eslint/eslint-plugin": "^5.15.0",

6
src/types/emotion.ts Normal file
View File

@@ -0,0 +1,6 @@
import { Theme as MuiTheme } from "@mui/material/styles";
declare module "@emotion/react" {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Theme extends MuiTheme {}
}

View File

@@ -17,7 +17,8 @@
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"jsxImportSource": "@emotion/react"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]

View File

@@ -65,7 +65,7 @@
"@babel/helper-validator-identifier" "^7.16.7"
to-fast-properties "^2.0.0"
"@emotion/babel-plugin@^11.7.1":
"@emotion/babel-plugin@^11.7.1", "@emotion/babel-plugin@^11.7.2":
version "11.7.2"
resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.7.2.tgz#fec75f38a6ab5b304b0601c74e2a5e77c95e5fa0"
integrity sha512-6mGSCWi9UzXut/ZAN6lGFu33wGR3SJisNl3c0tvlmb8XChH1b2SUvxvnOh7hvLpqyRdHHU9AiazV3Cwbk5SXKQ==