@ords/react-tcli
Typescript rewire of react-scripts where you can extend the webpack config. This is not a fork of react-script but it builds on top of any published react-scripts libary.
Last updated 2 years ago by runekongsgaard .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ords/react-tcli 
SYNC missed versions from official npm registry.

react-tcli

Typescript rewire of react-scripts where you can extend the webpack config. This is not a fork of react-script but it builds on top of any published react-scripts libary.

common issues

Python with sass for windows: npm config set python "path/to/python"

Features

  • CSS modules and "normal" css
  • Jest, Enzyme and React with react-scripts and ts-jest
  • Typescript
  • Synthetic default import
  • Dynamic imports
  • Tslint
  • Path alias for typescript

Disclaimer

This is a work in progress. If you find any bug or want better documentation please let us know!

Install (getting started)

run npm install @ords/react-tcli or do a global install npm install @ords/react-tcli -g.

You can then setup a new project with: react-tcli init. This will create a new folder called sampleProject.

If you have an exisiting project then modify your package.json you can add the following scripts:

"test": "react-tcli --src customPath/To/Src --withLatestReactEnzyme",
"start": "react-tclit --src customPath/To/Src",
"build": "react-tclit --src customPath/To/Src"

Suggested tslint

Use the build in linter by adding a tslint.json file in the root of your project with the following:

{ "extends": [ "./node_modules/@ords/react-tcli/dist/defaultConfigurations/tslint.json" ] }

Suggested and tested tsconfig compiler options

We only support a target of es5. To use our tsconfig, create your own with the following content:

{ "extends": "./node_modules/@ords/react-tcli/dist/defaultConfigurations/tsconfig.json" }

CSS modules

You can use traditional css import or name your files .module.css to use css modules.

Commands

Any commands that use webpack can have the configuration extended. Configurations for all the commands are described in this section.

Command init

Creates a new project

Command test

Use Jest to run test as of react-scripts. Filenames should be [name].spec.(ts|tsx|js|jsx)

Prop Default Description
--src src Location of test source files
--env undefined please specify jsdom to use mount in jest
--setupTestFile undefined Location of jest setupTestFile
--withLatestReactEnzyme undefined Using setupTestFile from this project

Command start

Use webpack to serve and develop your react project

Prop Default Description
--src src Location of source files
--public public Location of react public dir
--extendWebpackFile undefined Location of file to extend webpack config

Command build

Use webpack to build your react project

Prop Default Description
--src src Location of source files
--public public Location of react public dir
--extendWebpackFile undefined Location of file to extend webpack config

More features

Are we missing anything? Should the project be even more configurable? Let us know!

Current Tags

  • 2.0.0                                ...           latest (2 years ago)

25 Versions

  • 2.0.0                                ...           2 years ago
  • 1.7.0                                ...           2 years ago
  • 1.6.0                                ...           2 years ago
  • 1.5.4                                ...           2 years ago
  • 1.5.3                                ...           2 years ago
  • 1.5.2                                ...           2 years ago
  • 1.5.1                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.1                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 2
Last Month 10
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |