Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Compatible with react-scripts-ts? #22

@mikewheaton

Description

@mikewheaton

I'm attempting to get this working with a Create React App project that's using react-scripts-ts. Here's what I've tried:

  1. npm install --save-dev babel-plugin-styled-components
  2. npm install --save react-app-rewire-styled-components
  3. npm install --save-dev react-app-rewired
  4. Add a config-overrides.js file to the root:
const rewireStyledComponents = require('react-app-rewire-styled-components');

module.exports = function override(config, env) {
  config = rewireStyledComponents(config, env, {
    displayName: true
  });
  return config;
}
  1. Add a .babelrc file to the root:
{
  "plugins": ["babel-plugin-styled-components"]
}

  1. Update package.json:
    "start": "react-app-rewired start --scripts-version react-scripts-ts",
    "build": "react-app-rewired build --scripts-version react-scripts-ts",
    "test": "react-app-rewired test --env=jsdom --scripts-version react-scripts-ts",
  1. npm start

Unfortunately, it doesn't seem to be working as the friendly class names aren't included:
image

Do you have any ideas on what I might try next to get this working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions