MCPcopy Index your code
hub / github.com/SZzzzz/react-scripts-ts-antd

github.com/SZzzzz/react-scripts-ts-antd @v2.13.2-stable

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.13.2-stable ↗ · + Follow
143 symbols 304 edges 83 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Create React apps (with Typescript and antd) with no build configuration.

base on react-scripts-ts@2.13.0

Usage

create a new project with create-react-app

create-react-app myapp --scripts-version=react-scripts-ts-antd

Features

Include ts-import-plugin for importing components on demand.

// source
import { Card } from 'antd';

// output
import Card from 'antd/lib/card';
import Card from 'antd/lib/card/style/index.less';

Include react-app-rewired

You can rewire your webpack configurations without eject.

// You can get all default loads
const { loaders } = require('react-scripts-ts-antd');

Support scss and less

  • use less-loader for less.
  • use precss for scss.

Turn on some options of compileOptions in tsconfig.json.

// tsconfig.json
{
    "allowSyntheticDefaultImports": "true",
    "experimentalDecorators": "true"
}

Tips

How to avoid importing styles twice

If you want to customize theme by overriding less variables like below.

// index.less
@import "~antd/dist/antd.less";
@primary-color: #000;

You have imported all styles and ts-import-plugin will import styles again. So you need to reset ts-loader options by modifying config-overrides.js to avoid importing styles twice.

// config-overrides.js
const { getLoader } = require("react-app-rewired");

module.exports = function override(config, env) {

  // get tsloader
  const tsloader = getLoader(
    config.module.rules,
    rule => String(rule.test) == String(/\.(ts|tsx)$/)
  );

  // set new options
  tsloader.options = {
    transpileOnly: true,
    getCustomTransformers: () => ({
      before: [
        tsImportPluginFactory([
          {
            libraryName: 'antd',
            libraryDirectory: 'lib',
          },
          {
            libraryName: 'antd-mobile',
            libraryDirectory: 'lib',
          }
        ])
      ]
    })
  }
  return config;
};

antd package will be installed automatically.If you need antd-mobile, install it manually.

react-scripts

This package includes scripts and configuration used by Create React App.

Please refer to its documentation:

Core symbols most depended-on inside this repo

Shape

Method 70
Class 38
Function 35

Languages

TypeScript100%

Modules by API surface

fixtures/kitchensink/src/App.js11 symbols
fixtures/kitchensink/src/features/syntax/CustomInterpolation.js8 symbols
fixtures/kitchensink/src/features/syntax/TemplateInterpolation.js7 symbols
fixtures/kitchensink/src/features/syntax/RestParameters.js7 symbols
fixtures/kitchensink/src/features/syntax/RestAndDefault.js7 symbols
fixtures/kitchensink/src/features/syntax/Promises.js7 symbols
fixtures/kitchensink/src/features/syntax/ObjectSpread.js7 symbols
fixtures/kitchensink/src/features/syntax/ObjectDestructuring.js7 symbols
fixtures/kitchensink/src/features/syntax/Generators.js7 symbols
fixtures/kitchensink/src/features/syntax/DestructuringAndAwait.js7 symbols
fixtures/kitchensink/src/features/syntax/DefaultParameters.js7 symbols
fixtures/kitchensink/src/features/syntax/ComputedProperties.js7 symbols

For agents

$ claude mcp add react-scripts-ts-antd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page