1.0.1 • Published 3 years ago

babel-plugin-prepend-text v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

babel-plugin-prepend-text

This plugin was created only for one purpose to prepend font-family before each styled.Text in react-native projects, but it may be helpful in some other cases.

Usage

In .babelrc add this plugin with config where keys are names of tagged template functions and values are text which should be prepended

{
  "plugins": [
    ["prepend-text", {
      "styled.Text": "font-family: Roboto;"
    }]
  ]
}

Input code

const Title = styled.Text`
    color: white;
`;

Output code

const Title = styled.Text`font-family: Roboto;
    color: white;
`;
1.0.1

3 years ago

1.0.0

3 years ago