How do I build the extension after making changes?

I have modified the hello-world-extension and trying to rebuild to see the changes.

[original thread by Nilabhra Patra]

Hi @nilabhra-patra . Have you followed this guide? https://www.theia-ide.org/doc/authoring_extensions

If so, just running “yarn” in the root of your extension should do the trick

[Nilabhra Patra]

Thank you! I will check on that

You can also do watching, so you do not have to rebuild everything after your change. Note, you have to watch your extension and the application as well: https://github.com/theia-ide/theia/blob/master/doc/Developing.md#watching

[Nilabhra Patra]

This is nice. Thanks for pointing out.

[Nilabhra Patra]

Me again. I changed the message from “Hello World” to “Test” in /workspace/theia/theia-hello-world-extension/hello-world-extension/src/browser/hello-world-extension-contribution.ts and trying to build. Ran “yarn” in root. Then ran yarn start in /workspace/theia/theia-hello-world-extension/browser-app. I am unable to see the changes. Am I missing something?

Can you give a brief overview about your project structure? But let’s assume you have a folder, let’s say root. Inside root, you have the browser-app and the electron-app. Also, you have a single extension: theia-hello-world-extension. When in root, I usually do yarn --cwd ./theia-hello-world-extension/ watch to compile the TS code if I change anything in my extension. Then I run yarn --cwd ./browser-app/ watch to watch the application. So when I change something in my extension, webpack will pick up my changes and update the bundle.js for the frontend code. Finally, I start the application with yarn --cwd ./browser-app/ start. All yarn commands run in a separate shell. Note, if you change anything in the backend, root/theia-hello-world-extension/src/node, you must restart the application. I hope this helps.

[Nilabhra Patra]

I am directly running the Theia repo in Gitpod. I can only see browser-app and electron-app in theia-hello-world-extension. Considering them to be the same that is mentioned before, I tried to built. Still I am not able to see my changes

@nilabhra-patra please read README file, it explains how you can incrementally develop your extension

it’s generated from https://github.com/theia-ide/generator-theia-extension/blob/master/templates/README.md#developing-with-the-browser-example

[Nilabhra Patra]

Thank you. I am able to see the changes.