Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make defined imports in your config override the preset #211

Merged
merged 1 commit into from
Nov 25, 2020

Conversation

ben-rogerson
Copy link
Owner

The imports you define in the twin config for styled, css and global will now override the imports defined in the preset.

This means you can define the preset and then adjust the imports you need:

// package.json
"babelMacros": {
  "twin": {
    "preset": "styled-components"
    "styled": { // Custom import
      "import": "default",
      "from": "styled-components/newImport"
    }
    // Twins other imports (css, global) are copied from the preset because they aren't being specified here
  }
},

@ben-rogerson ben-rogerson merged commit b74cf37 into master Nov 25, 2020
@ben-rogerson ben-rogerson deleted the feature/remove-preset-trump branch November 25, 2020 20:40
@ben-rogerson ben-rogerson changed the title Defined imports override the preset Make defined imports in your config override the preset Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant