Skip to content

Commit a4e545e

Browse files
committed
chore: externalize emotion
1 parent 48e402d commit a4e545e

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

package-lock.json

Lines changed: 7 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555
"upgrade-interactive": "npm-check -u"
5656
},
5757
"peerDependencies": {
58-
"@emotion/babel-plugin": "^11.9.2",
5958
"@emotion/react": "^11.9.0",
6059
"react": "^17.0.0 || ^18.0.0",
6160
"react-dom": "^17.0.0 || ^18.0.0"
6261
},
6362
"devDependencies": {
63+
"@emotion/babel-plugin": "^11.9.2",
6464
"@babel/core": "^7.18.0",
6565
"@size-limit/preset-small-lib": "7.0.8",
6666
"@storybook/addon-actions": "6.4.22",

vite.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,21 @@ export default defineConfig({
1212
fileName: (format) => `react-section-dividers.${format}.js`,
1313
},
1414
rollupOptions: {
15-
external: ['react'],
15+
external: [
16+
'react',
17+
'react-dom',
18+
'@emotion/core',
19+
'@emotion/react',
20+
'@emotion/css',
21+
'@emotion/styled',
22+
'@emotion/cache',
23+
'@emotion/serialize',
24+
'@emotion/utils',
25+
],
1626
output: {
1727
globals: {
1828
react: 'React',
29+
'@emotion/react': '@emotion/react',
1930
},
2031
},
2132
},

0 commit comments

Comments
 (0)