Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Latest commit

 

History

History
191 lines (122 loc) · 6.68 KB

File metadata and controls

191 lines (122 loc) · 6.68 KB

Hooks for roc-package-web-app-react-dev

Hooks

roc

update-settings

Expected to return new settings that should be merged with the existing ones.

Makes it possible to modify the settings object before a command is started and after potential arguments from the command line and configuration file have been parsed. This is a good point to default to some value if no was given or modify something in the settings.

Initial value: Nothing
Expected return value: Object()

Arguments

Name Description Type Required Can be empty
getSettings A function that returns the settings after the context has been initialized. Function No

roc-abstract-package-base-dev

after-clean

Hook point for adding code that runs after the clean command is invoked.

Initial value: Nothing
Expected return value: Nothing

before-clean

Hook point for adding code that runs before the clean command is invoked.

Initial value: Nothing
Expected return value: Array(String)

run-build-command

Use to add things that should react to the build command being called.

Initial value: Nothing
Expected return value: Function

Arguments

Name Description Type Required Can be empty
targets The targets to build for, will be based on settings or a possible argument if defined. Array(String) Yes No

run-dev-command

Use to add things that should react to the dev command being called.

Initial value: Nothing
Expected return value: Nothing

Arguments

Name Description Type Required Can be empty
targets The targets use for dev, will be based on settings or a possible argument if defined. Array(String) Yes No

roc-package-web-app-dev

server-started

Invoked when the server has started.

Initial value: Nothing
Expected return value: Nothing

Arguments

Name Description Type Required Can be empty
port The port of the server. Integer Yes No
path The path that the server has started on. String Yes No

roc-package-webpack-dev

babel-config

Used to create a Babel configuration to be used in the Webpack build.

Initial value: {}
Expected return value: Object()

Arguments

Name Description Type Required Can be empty
target The target that is used. String No Yes

build-webpack

Used to create the final Webpack configuration object.

Initial value: {}
Expected return value: Object()

Arguments

Name Description Type Required Can be empty
target The target for which the Webpack configuration should be build for. String No Yes
babelConfig The Babel configuration that should be used for the Webpack build. Object() No Yes

create-watchers

Used to add watchers that should follow a specific format.

Initial value: {}
Expected return value: Object(Function)

get-webpack-targets

Used to inform which targets that should be considered as Webpack targets. Actions should concat the previousValue to build the complete value.

Initial value: []
Expected return value: Array(String)

roc-package-webpack-node-dev

dev-process-created

Used to react to when the development server has started.

Initial value: Nothing
Expected return value: Nothing

Arguments

Name Description Type Required Can be empty
serverProcess The created server process. No

dev-process-stopping

Used to react before the development server is stopped.

Initial value: Nothing
Expected return value: Nothing

Arguments

Name Description Type Required Can be empty
serverProcess The server process that is being stopped. No

roc-plugin-style-css

add-style

Used for adding additional style loaders.

Important that the actions return an object matching the following:

{ extensions: String/[String], loaders: String/[String] }

Initial value: Nothing
Expected return value: Object(String / Array(String))

add-style-preloaders

Used to add general loaders early in the chain, before the PostCSS loader.

These loaders will be applied to all styles added from the add-style hook.

Initial value: Nothing
Expected return value: Array(String)