Package io.github.cdklabs.projen.web
Class ReactComponentOptions.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.web.ReactComponentOptions.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ReactComponentOptions>
- Enclosing interface:
- ReactComponentOptions
@Stability(Experimental) public static final class ReactComponentOptions.Builder extends Object implements software.amazon.jsii.Builder<ReactComponentOptions>
A builder forReactComponentOptions
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReactComponentOptionsbuild()Builds the configured instance.ReactComponentOptions.Builderrewire(Map<String,? extends Object> rewire)Sets the value ofReactRewireOptions.getRewire()ReactComponentOptions.Buildertypescript(Boolean typescript)Sets the value ofReactComponentOptions.getTypescript()
-
-
-
Method Detail
-
typescript
@Stability(Experimental) public ReactComponentOptions.Builder typescript(Boolean typescript)
Sets the value ofReactComponentOptions.getTypescript()- Parameters:
typescript- Whether to apply options specific for TypeScript React projects.- Returns:
this
-
rewire
@Stability(Experimental) public ReactComponentOptions.Builder rewire(Map<String,? extends Object> rewire)
Sets the value ofReactRewireOptions.getRewire()- Parameters:
rewire- 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; }- Returns:
this
-
build
@Stability(Experimental) public ReactComponentOptions build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ReactComponentOptions>- Returns:
- a new instance of
ReactComponentOptions - Throws:
NullPointerException- if any required attribute was not provided
-
-