se-cra-react-scripts
v4.3.0
Published
Configuration and scripts for Create React App.
Readme
react-scripts
This fork includes the following changes:
New Webpack Configuration:
- Introduces 2 webpack configurations with a different entry point:
src/widget.js. - Aims to output a single JavaScript file.
- Outputs everything to
/widgetand/widget-umdby default. - The news webpack configurations accepts the following environment variables:
WIDGET_PUBLIC_URL(similar toPUBLIC_URL): Defaults to"/widget/".WIDGET_BUILD_PATH(similar toBUILD_PATH): Defaults to"build/widget".WIDGET_UMD_PUBLIC_URL(similar toPUBLIC_URL): Defaults to"/widget-umd/".WIDGET_UMD_BUILD_PATH(similar toBUILD_PATH): Defaults to"build/widget-umd".
- There are 2 new outputs, SystemJS named after the
namefield in the project'spackage.jsonfile when using CRA and UMD namedLAYOUT.
- Introduces 2 webpack configurations with a different entry point:
Development Mode Enhancements:
- Dev server has CORS enabled
- You can pass 2 new arguments
--widgetand--widget-umdto thestartscript in development mode.- When the
--widgetargument is passed,webpack-dev-serveruses a new webpack configuration that outputs SystemJS. - When the
--widget-umdargument is passed,webpack-dev-serveruses a new webpack configuration that outputs UMD.
- When the
webpack-dev-serveraccepts the following environment variable:WIDGET_PORT(similar toPORT): Defaults to3210.WIDGET_UMD_PORT(similar toPORT): Defaults to3220.
Proxying Requests in Development Mode:
- In development mode, all requests to
/widget/**/*are proxied to the/widget/**/*path of thewebpack-dev-serverinstance running with the--widgetargument. - In development mode, all requests to
/widget-umd/**/*are proxied to the/widget-umd/**/*path of thewebpack-dev-serverinstance running with the--widget-umdargument.
- In development mode, all requests to
Steps to test locally
# in this directory, run
$ yarn link
# in `viz-omni/frontend-neo/layout-editor`
$ yarn link se-cra-react-scriptsSteps to publish to npm
Update package.json version
Run:
$ npm login # update package.json version $ npm publish
Troubleshooting
Uncaught ReferenceError: process is not defined
Latest versions of
react-error-overlayhave that bug. Add the following to yourpackage.jsonto fix it:"resolutions": { "react-error-overlay": "6.0.8" },
This package includes scripts and configuration used by Create React App. Please refer to its documentation:
- Getting Started – How to create a new app.
- User Guide – How to develop apps bootstrapped with Create React App.
