add command set-figwheel-port
- used to set custom figwheel port in config.cljs - fixes #151
This commit is contained in:
parent
ce42e1bbd1
commit
5f6da94ae7
|
@ -901,6 +901,13 @@ autoRequire = (enabled, globally = false) ->
|
||||||
else
|
else
|
||||||
log "Auto-Require feature is disabled in use-figwheel command"
|
log "Auto-Require feature is disabled in use-figwheel command"
|
||||||
|
|
||||||
|
setFigwheelPort = (port, globally = false) ->
|
||||||
|
configFile = if globally then '.re-natal' else '.re-natal.local'
|
||||||
|
config = merge(readConfig(configFile, false), figwheelPort: port)
|
||||||
|
writeConfig(config, configFile)
|
||||||
|
log "Figwheel port is set to #{port}"
|
||||||
|
log "Please run: re-natal use-figwheel to take effect."
|
||||||
|
|
||||||
cli._name = 're-natal'
|
cli._name = 're-natal'
|
||||||
cli.version pkgJson.version
|
cli.version pkgJson.version
|
||||||
|
|
||||||
|
@ -989,6 +996,12 @@ cli.command 'enable-source-maps'
|
||||||
.action () ->
|
.action () ->
|
||||||
patchReactNativePackager()
|
patchReactNativePackager()
|
||||||
|
|
||||||
|
cli.command 'set-figwheel-port <port>'
|
||||||
|
.description 'configures the port of figwheel server (port 3449 is default)'
|
||||||
|
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
||||||
|
.action (port, cmd) ->
|
||||||
|
setFigwheelPort(port, cmd.global)
|
||||||
|
|
||||||
cli.command 'enable-auto-require'
|
cli.command 'enable-auto-require'
|
||||||
.description 'enables source scanning for automatic required module resolution in use-figwheel command.'
|
.description 'enables source scanning for automatic required module resolution in use-figwheel command.'
|
||||||
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
.option '-g --global', 'use global .re-natal config instead of .re-natal.local'
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
(def figwheel-urls {
|
(def figwheel-urls {
|
||||||
{{#each platforms}}
|
{{#each platforms}}
|
||||||
:{{@key}} "ws://{{this.host}}:3449/figwheel-ws"
|
:{{@key}} "ws://{{this.host}}:{{#if ../figwheelPort}}{{../figwheelPort}}{{else}}3449{{/if}}/figwheel-ws"
|
||||||
{{/each}}
|
{{/each}}
|
||||||
})
|
})
|
Loading…
Reference in New Issue