Skip to content

Commit 4c2b267

Browse files
author
liuyi
committed
feat: support importing from custom module
1 parent dce165e commit 4c2b267

17 files changed

+1112
-197
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,32 @@ module.exports = {
142142
}
143143

144144
```
145+
146+
for customized exported(re-exported) styled
147+
148+
```ts
149+
interface CustomModule {
150+
// module name used in import statement
151+
moduleName: string
152+
// `true` if you may import libs from 'my-emotion/subpath'
153+
includesSubPath?: boolean
154+
// all available names exported from custom module
155+
exportedNames: string[]
156+
// we may do some additional work on styled function, so if styled is reexport, you should specify it here
157+
styledName?: string
158+
// has default export
159+
hasDefaultExport?: boolean
160+
}
161+
162+
createEmotionPlugin({
163+
...otherConfig,
164+
customModules: [
165+
{
166+
moduleName: 'my-emotion',
167+
includesSubPath: true,
168+
exportedNames: ['myStyled', 'myCss']
169+
styledName: 'myStyled',
170+
}
171+
]
172+
})
173+
```

0 commit comments

Comments
 (0)