How to add additional pages ? How to layout code to share components between pages ? #662
-
I'm prototyping plasmo to migrate an extension project from a customized vite build process to something more modern. This is the first time I try this framework, I hope I have not missed some obvious things. The purpose of my extension is to add a button on top of some html form fields, based on some business rules. When the button is clicked, a modal should open, ask for some user input and inject data in the form field. Current implementaion have a What is the proper plasmo way to achieve the same? What I tried:
Unfortunately, it does not works.
Which is weird, since the Even weirder, when I run a second time the build command, I get a new error:
Seems like everytime I try to build, the compiler is able to advance one more step. I feel confused. The documentation did not help me to understand:
I strongly feel plasmo will have a great value in my project (multiple browser target, hot refresh, ...). But only if I can actually bootstrap my project. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
TRied using "tab" page instead of sandbox, but still have compilation issues |
Beta Was this translation helpful? Give feedback.
-
Finally rebuilt, step by steps the extension. This time, everything is working as expected. Not sure to get exactly what was wrong, but to conclude I had to create a new "Tab" page, declare it in the manifest part inside the package.josn file |
Beta Was this translation helpful? Give feedback.
-
The tab page should be the right thing to use: https://docs.plasmo.com/framework/tab-pages
We should add a "Best practice" for this? This portion is left out because we were still building out the framework and I was hoping that the framework ought to support many variation of code structure. But the higher level gist/limitation is that:
Based on the verbose log (thanks for it btw, super helpful), it seems |
Beta Was this translation helpful? Give feedback.
-
Thanks for your concern. I didn't keep my repro, since it was not working |
Beta Was this translation helpful? Give feedback.
Finally rebuilt, step by steps the extension.
This time, everything is working as expected.
Not sure to get exactly what was wrong, but to conclude I had to create a new "Tab" page, declare it in the manifest part inside the package.josn file