Package Exports
- @ords/react-tcli
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ords/react-tcli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-tcli
Typescript rewire of react-scripts where you can extend the webpack config. This project extends the functionality of react-scripts by adding another script called storybook. This is not a fork of react-script but it builds on top of any published react-scripts libary.
Disclaimer
This is a work in progress. If you find any bug or want better documentation please let us know!
Install
run npm install @ords/react-tcli
In your package.json you can add the following scripts:
"test": "react-tcli --src sampleProject --setupTestFile sampleProject/setupTestFile.js",
"start": "react-tclit --src sampleProject/src --public sampleProject/public",
"build": "react-tclit --src sampleProject/src --public sampleProject/public",
"storybookDev": "react-tcli --src sampleProject/src",
"storybookBuild": "react-tcli --src sampleProject/src"Suggested tsconfig compiler options
"target": "es5",
"module": "commonjs",
"strict": true,
"sourceMap": true,
"noImplicitAny": false,
"allowJs": true,
"noUnusedLocals": true,
"allowSyntheticDefaultImports": true,
"jsx": "react"Commands
Any commands that use webpack can have the configuration extended. Configurations for all the commands are described in this section.
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 |
| --setupTestFile | undefined | Location of jest setupTestFile |
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 |
Command storybookDev
Use webpack to develop your react storybook project. Filenames should be [name].story.(ts|tsx|js|jsx)
| Prop | Default | Description |
|---|---|---|
| --src | src | Location of storybook files |
| --extendWebpackFile | undefined | Location of file to extend webpack config |
Command storybookBuild
Use webpack to develop your react storybook project. Filenames should be [name].story.(ts|tsx|js|jsx)
| Prop | Default | Description |
|---|---|---|
| --src | src | Location of storybook files |
| --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!