Package io.github.cdklabs.projen.web
Class ReactComponent.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.web.ReactComponent.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ReactComponent>
- Enclosing class:
- ReactComponent
@Stability(Experimental) public static final class ReactComponent.Builder extends Object implements software.amazon.jsii.Builder<ReactComponent>
(experimental) A fluent builder forReactComponent.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ReactComponentbuild()static ReactComponent.Buildercreate(NodeProject project)ReactComponent.Builderrewire(Map<String,? extends Object> rewire)(experimental) Rewire webpack configuration.ReactComponent.Buildertypescript(Boolean typescript)(experimental) Whether to apply options specific for TypeScript React projects.
-
-
-
Method Detail
-
create
@Stability(Experimental) public static ReactComponent.Builder create(NodeProject project)
- Parameters:
project- This parameter is required.- Returns:
- a new instance of
ReactComponent.Builder.
-
rewire
@Stability(Experimental) public ReactComponent.Builder rewire(Map<String,? extends Object> rewire)
(experimental) Rewire webpack configuration.Use this property to override webpack configuration properties provided by create-react-app, without needing to eject.
This property will create a
config-overrides.jsfile in your root directory, which will contain the desired rewiring code.To override the configuration, you can provide simple key value pairs. Keys take the form of js code directives that traverse to the desired property. Values should be JSON serializable objects.
For example, the following config:
rewire: { "module.unknownContextCritical": false }Will translate to the following
config-overrides.jsfile:module.exports = function override(config, env) { config.module.unknownContextCritical = false; }Default: - No rewired config.
- Parameters:
rewire- Rewire webpack configuration. This parameter is required.- Returns:
this- See Also:
- https://github.com/timarney/react-app-rewired
-
typescript
@Stability(Experimental) public ReactComponent.Builder typescript(Boolean typescript)
(experimental) Whether to apply options specific for TypeScript React projects.Default: false
- Parameters:
typescript- Whether to apply options specific for TypeScript React projects. This parameter is required.- Returns:
this
-
build
@Stability(Experimental) public ReactComponent build()
- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ReactComponent>- Returns:
- a newly built instance of
ReactComponent.
-
-