Closed adamplouff closed 11 months ago
If you have 2 panels with varying code bases, then there "should" be 3 JS files generated, one for each panel and one containing all shared assets.
example:
panel-a.js
panel-b.js
shared.js
However I believe the issue you're facing is caused by using the same index.html
for both panels. For multi-panel extensions, try separating them into something like:
./main/index.html
./server/index.html
and update your cep.config.ts
to:
{
mainPath: "./settings/index.html",
name: "server",
type: "Custom",
startOnEvents: ["com.adobe.csxs.events.ApplicationInitialized", "applicationActivate"],
autoVisible: false,
width: 600,
height: 650,
},
That should resolve the issue, let me know if that works. Thanks!
That should resolve it, but if the issue pops up again, feel free to re-open this issue.
Confirmed: this works.
I misunderstood how panels load different html and js files –and how segmenting this data is good practice for reducing redundancies with unnecessary duplications.
Create a new folder that matches the second panel mainPath: "./server/index.html",
├── src
│ ├── main
│ │ ├── index.html
│ │ ├── main.svelte
│ │ ├── main.ts
│ ├── server
│ │ ├── index.html
│ │ ├── main.ts
[!note] Since the server panel is headless it doesn't need the
main.svelte
file for UI. Even more savings. Just had to includeexport {}
at the end of themain.ts
file to load correctly as a module.
Thanks @justintaylor-dev
@justintaylor-dev I have 2 panel in separate folders with two index.html and entry ts files:
but got the same error:
The bolt-xxxxx.js
is required by server-panel's index.js :
Update:
require('./bolt-eab1bcc9.js')
does not work but require('bolt-eab1bcc9.js')
works in devtool:
But the error remains even if I changed require('./bolt-eab1bcc9.js')
to require('bolt-eab1bcc9.js')
in the index.js.
@aztack are you on the latest version of vite-cep-plugin
?
Non-working example (Overlord 2)
I am working on an extension with a visible and invisible panel that talk to one another. When developing everything works great, but once the ZXP is built, it seems like having 2 panels defined in
cep.config.ts
breaks the build.Generates an
index.html
ending withThe filename
server-509d7a18.js
seems to be related to the second panelname: "server",
incep.config.ts
which then points to./main-66f56e2c.js
When installing from the built ZXP, the panel is blank. Debugging returns the error:
Working setup (Rubberhose 3)
Having a single panel declared in
cep.config.ts
works great.Generates an
index.html
ending withThe reference to
main-0c1c973d.js
is the real js code: