File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
packages/babel-plugin-emotion Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1515 "dependencies" : {
1616 "autoprefixer" : " ^7.1.2" ,
1717 "babel-plugin-syntax-jsx" : " ^6.18.0" ,
18+ "babel-macros" : " ^1.0.1" ,
1819 "emotion-utils" : " ^7.2.2" ,
1920 "postcss" : " ^6.0.9" ,
2021 "postcss-js" : " ^1.0.0" ,
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ import {
55import { buildMacroRuntimeNode } from './babel-utils'
66import emotionMacro from './macro'
77import { omit } from 'emotion-utils'
8+ import { createMacro } from 'babel-macros'
89
9- module . exports = function macro ( options ) {
10+ module . exports = createMacro ( macro )
11+
12+ function macro ( options ) {
1013 const { references, state, babel : { types : t } } = options
1114 if ( ! state . inline ) state . inline = true
1215 let referencesWithoutDefault = references
Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ import {
44} from './index'
55import { buildMacroRuntimeNode , addRuntimeImports } from './babel-utils'
66import { forEach , keys } from 'emotion-utils'
7+ import { createMacro } from 'babel-macros'
78
8- module . exports = function macro ( { references, state, babel : { types : t } } ) {
9+ module . exports = createMacro ( macro )
10+
11+ function macro ( { references, state, babel : { types : t } } ) {
912 if ( ! state . inline ) state . inline = true
1013 forEach ( keys ( references ) , referenceKey => {
1114 if ( referenceKey === 'injectGlobal' ) {
You can’t perform that action at this time.
0 commit comments