Skip to content

Commit 74724e2

Browse files
committed
feat: Add emotion config
1 parent 64df523 commit 74724e2

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

template.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"dependencies": {
33
"@craco/craco": "^5.6.2",
4+
"@emotion/core": "^10.0.27",
5+
"@emotion/styled": "^10.0.27",
46
"@reduxjs/toolkit": "^1.1.0",
57
"@testing-library/jest-dom": "^4.2.4",
68
"@testing-library/react": "^9.3.2",
@@ -12,6 +14,7 @@
1214
"@types/react-redux": "^7.1.5",
1315
"@types/react-router": "^5.1.3",
1416
"@types/react-router-dom": "^5.1.3",
17+
"babel-plugin-emotion": "^10.0.27",
1518
"eslint-plugin-simple-import-sort": "^5.0.0",
1619
"react": "^16.12.0",
1720
"react-dom": "^16.12.0",

template/craco.config.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
const path = require("path");
2-
const resolve = arg => path.resolve(__dirname, arg);
1+
const path = require('path')
2+
const resolve = arg => path.resolve(__dirname, arg)
33

44
module.exports = function() {
55
return {
6+
babel: {
7+
plugins: [
8+
[
9+
'emotion',
10+
{
11+
labelFormat: '[filename]--[local]',
12+
},
13+
],
14+
],
15+
},
616
webpack: {
717
alias: {
8-
"@": resolve("src")
9-
}
18+
'@': resolve('src'),
19+
},
1020
},
1121
jest: {
1222
configure: {
1323
moduleNameMapper: {
14-
"^@/(.*)$": "<rootDir>/src/$1"
15-
}
16-
}
17-
}
18-
};
19-
};
24+
'^@/(.*)$': '<rootDir>/src/$1',
25+
},
26+
},
27+
},
28+
}
29+
}

0 commit comments

Comments
 (0)