WebUI - Bundle the compiled js into the go binary

Labels: area/ui/web

Timeline

Cláudio Silva (claudioantonio) opened

After You merge #548 can We bundle a new WebUI release into the go binary?

Michael Muré (MichaelMure) commented

Sure thing but I'm not sure there is a point without also making a release (bug git-bug is not in a release state at the moment). If you want to do that, you can run make pack-webui from the root and make a PR with the result.

Cláudio Silva (claudioantonio) commented

Based on the article below I tried to pack webui but have no success... :( https://dzone.com/articles/makefile-command-in-windows

Error messages

PS D:\dev\goodfirstissues\git-bug-2> make pack-webui process_begin: CreateProcess(NULL, uname -s, ...) failed. npm run --prefix webui build

webui@0.1.0 build D:\dev\goodfirstissues\git-bug-2\webui npm run generate && react-scripts build

webui@0.1.0 generate D:\dev\goodfirstissues\git-bug-2\webui graphql-codegen

√ Parse configuration √ Generate outputs Creating an optimized production build... Compiled successfully.

File sizes after gzip:

229.3 KB (-64 B) build\static\js\2.2013acb7.chunk.js 9.15 KB build\static\js\main.c1c3dd52.chunk.js 768 B build\static\js\runtime-main.c79097da.js

The project was built assuming it is hosted at /. You can control this with the homepage field in your package.json.

The build folder is ready to be deployed. You may serve it with a static server:

npm install -g serve serve -s build

Find out more about deployment here:

https://cra.link/deployment

go run webui/pack_webui.go process_begin: CreateProcess(NULL, go run webui/pack_webui.go, ...) failed. make (e=2): The system cannot find the file specified. make: *** [pack-webui] Error 2

Do You have any idea about that?

Cláudio Silva (claudioantonio) commented (edited)

When I run make into webui folder the message is: PS D:\dev\goodfirstissues\git-bug-2\webui> make pack-webui make: No rule to make target `pack-webui'. Stop.

Cláudio Silva (claudioantonio) commented

Makefile into webui folder really does not have this target pack-webui

start: npm start

install: npm install

test: npm run generate npm run lint CI=true npm run test

build: npm run build

lint: npm run lint

fix-lint: npm run lint -- --fix

Cláudio Silva (claudioantonio) commented

@MichaelMure I think that even if the Makefile had a target "pack-webui" It would be necessary to have Go installed in my machine to execute pack_webui.go, correct?

Michael Muré (MichaelMure) commented

As you probably have found by now, you need to:

  1. build the webui from the /webuifolder
  2. pack the webui from the /folder

Cláudio Silva (claudioantonio) added label area/ui/web

Michael Muré (MichaelMure) closed the bug