Skip to content

Commit 0180e37

Browse files
committed
feat(babel-plugin-rn-stylename-inline): infer platform dynamically from Metro options
1 parent a997099 commit 0180e37

File tree

1 file changed

+1
-1
lines changed
  • packages/babel-plugin-rn-stylename-inline

1 file changed

+1
-1
lines changed

packages/babel-plugin-rn-stylename-inline/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const getVisitor = ({ $program, usedCompilers }) => ({
3535
// II. compile template
3636
const source = $this.node.quasi.quasis[0]?.value?.raw || ''
3737
const filename = state.file?.opts?.filename
38-
const platform = state.opts?.platform || DEFAULT_PLATFORM
38+
const platform = state.opts?.platform || state.file?.opts?.caller?.platform || DEFAULT_PLATFORM
3939
const compiledString = compiler(source, filename, { platform })
4040
const compiledExpression = parser.parseExpression(compiledString)
4141

0 commit comments

Comments
 (0)