Replies: 1 comment
-
Here's an example, but it's quite old: https://github.com/anime-skip/player It has a shared package, Note that I am consuming the player package as an NPM package, it is built to JS and |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If you have a website that you want to show as an extension (or parts / componengts of it or whatever), I AFAIK see no docs explaining the best practices. Especially as wxt seem to be opinionated about the project structure this may easily lead to clashes...
Context
I am building a little website. Coming from that initial website that is basically just storing data I thought we need to store/sync data and thus "converted" it into a WebExtension for data storage via
browser.storage.sync(or similar APIs).Anyway, the more generic question is: If you have an existing website, how to best transform it respectively use it's code (Vue components etc:) to add a
Search
I saw the page "Migrate to WXT", but essentially, it's docs about migrating from an existing extension. (BTW, it does not mention this. Aka it does not say what the migration guide covers = what the source of the migration is.)
So this doe snot really apply to websites, apparently.
Problems
I tried with LLM help and it kinda works, but:
first of all, I tried just running it in a sub-directory of an existing repo (see Initialisation fails when rujnning in existing git sub-directory #2289), which works and creates an extension
however, now importing stuff from the "parent" directory caused much paint for TS module resolution etc.
/srccontains the website source code. Even if compiled from the/extensiondirectory, it obviously cannot be resolved.generally, you then end up with two
package.jsonfiles etc. etc. - I guess this is not best practice?Same for TS
tsconfig.jsonis duplicated, though wxt is special here again, because it ships with it's own tsconfig (which is generated?) - which does not make it easier to accomplish the task to "merge" such a website project into the extension (or vice versa for that matter):Especially, all this can cause conflicts, if packages or if the TS config actually differs, does not it?
Fundamentally, also the project structure is not clear and totally unsolved here. Should a wxt extension belong in it's own sub-directory (like
/extension) or should it be at the root? If at the root, does it even make sense to run this?Probably there are more issues that I do not see yet. Are there, after all?
Example project: https://github.com/rugk/gzgtracker (commit adding website using browser, commit merging package.json and different build-roots together)
Essentially I am asking for a best practice here...
Beta Was this translation helpful? Give feedback.
All reactions