• This repository has been archived on 11/Oct/2022
  • Stars
    star
    170
  • Rank 218,796 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Add the styled-components Babel plugin to your create-react-app app via react-app-rewired

react-app-rewire-styled-components

Add the babel-plugin-styled-components to your create-react-app app via react-app-rewired.

This gives you nicer generated class names that include the components' name, minification of styles and many more goodies πŸ’ͺ

Installation

npm install --save react-app-rewire-styled-components
# alternatively if you have yarn installed
yarn add react-app-rewire-styled-components

Usage

In the config-overrides.js you created for react-app-rewired add this code:

const rewireStyledComponents = require('react-app-rewire-styled-components');

/* config-overrides.js */
module.exports = function override(config, env) {
  config = rewireStyledComponents(config, env);
  return config;
}

That's it, you're now using the styled-components Babel plugin!

To pass options to the Babel plugin use the third argument, it passes straight through to the plugin:

config = rewireStyledComponents(config, env, {
  ssr: true,
})

See the available options in the styled-components documentation.

License

Licensed under the MIT License, Copyright ©️ 2017 Maximilian Stoiber. See LICENSE.md for more information.

More Repositories

1

spectrum

Simple, powerful online communities.
JavaScript
10,769
star
2

micro-open-graph

A tiny Node.js microservice to scrape open graph data with joy.
JavaScript
379
star
3

graphql-log

Add logging to your GraphQL resolvers so you know what's going on in your app.
JavaScript
96
star
4

callback-to-async-iterator

Turn any callback-based listener into an async iterator.
JavaScript
94
star
5

code-of-conduct

The Code of Conduct for all communities on Spectrum
58
star
6

redis-tag-cache

Cache and invalidate records in Redis with tags
JavaScript
53
star
7

draft-js-prism-plugin

Add syntax highlighting support to your DraftJS editor
JavaScript
49
star
8

slate-markdown

Add live markdown preview support to your Slate editor.
JavaScript
45
star
9

draft-js-code-editor-plugin

Add IDE-like behaviours to code blocks in your DraftJS editors
JavaScript
36
star
10

danger-plugin-no-console

DangerJS plugin to prevent merging any code that contains console log statements
JavaScript
32
star
11

badge

Spectrum badge for GitHub READMEs
28
star
12

npm-pkg

Create your npm package with ESNext, Flowtype and prettier.
JavaScript
24
star
13

markdown-linkify

Turn plain URLs in text into Markdown links. Works in the browser and on the server.
JavaScript
23
star
14

slate-mentions

Add support for mentions to your Slate editor.
JavaScript
22
star
15

micro-code-analyser

A tiny Node.js microservice to detect the language of a code snippet
JavaScript
22
star
16

danger-plugin-flow

Ensure all JS files that get touched in a PR are flow typed
TypeScript
22
star
17

micro-anonymizomatic

A microservice to anonymize strings
JavaScript
18
star
18

danger-plugin-labels

Let any contributor add labels to their PRs and issues
TypeScript
17
star
19

micro-redirect

A tiny Node.js microservice to redirect users to a different location.
JavaScript
16
star
20

jscodeshift-graphql-files

Transform .js files with GraphQL template literals into .graphql files
JavaScript
14
star
21

rethinkdb-inspector

πŸ•΅οΈβ€β™€οΈ Inspect your RethinkDB queries and find out how fast they are. (compatible with rethinkdbdash)
JavaScript
12
star
22

franz-spectrum

JavaScript
6
star
23

micro-markdown-converter

A tiny Node.js microservice to convert markdown to raw DraftJS content state and vice-versa
JavaScript
5
star
24

draft-js-validate

[WIP DOES NOT WORK YET]
JavaScript
2
star
25

peril-settings

This contains our Dangerfiles
TypeScript
1
star