How to customize parcel config?

Hi everyone, I am trying to use a react-native based library called react-native-reanimated. This library has some components that are also supported for the web, and they write 2 files, for example a measure component will have measure.tsx and measure.web.tsx file. When I use this library in a nextJS project, it bundles the correct file for web, which is measure.web.tsx, however with plasmo, it seems like it only bundles the files with extensions .ts or .js etc..., and skips the equivalent .web.* file. How do I make parcel make the files that end in .web.* take precendence over .js|ts(x) files?
Arcane
Arcane59d ago
@LoXatoR has reached level 1. GG!
LoXatoR
LoXatoR59d ago
This one has code specific for react-native, and doesn't work on the web but the web file is not bundled
No description
LoXatoR
LoXatoR59d ago
In the nextJS app you can see that it bundles the .web.js file
No description
LoXatoR
LoXatoR55d ago
any idea bout this @lab ?
lab
lab46d ago
We recently merged a thing for this: https://github.com/PlasmoHQ/plasmo/pull/890
GitHub
feat: Support custom .parcelrc config by mathieudutour · Pull Reque...
Details This PR introduces support for a custom .parcelrc at the root of the project. It will warn the user if the config doesn't extend Plasmo's one. This serves as an escape hatch for thi...
LoXatoR
LoXatoR46d ago
Yes, I tried to follow that by introducing a custom .parcelrc , was wondering if you had an idea on how to solve the above issue (I am not 100% sure if a custom parcel config would solve it)
lab
lab45d ago
Generally, I'd just do a common index.ts file and import per platform based on a .env variable That'd help parcel cherry pick the file for you The internal resolver is not react-native aware, the current example is simply exploiting the fact that looks up the index file FYI, plasmo also looks up browser target specific files like index.chrome.ts etc... But for your issue, I'd just use index.ts with an env, and lazy load your component as needed
LoXatoR
LoXatoR41d ago
Thanks for answering, I will give it a shot!
Ymir
Ymir38d ago
@lab with-custom-parcel example ( & mention in docs ) would be really helpful here! 🙂
Want results from more Discord servers?
Add your server
More Posts
React route is rendered twice when I use useStorage hookHey everyone, I'm having an issue with my extension. I'm using Plasmo and react-router together. WHow can I send a message from BGSW to content script and back?The messaging documentation hardly touches on this issue, the only thing I managed to find is that ITab page injecting CSS into website's runtimeI am devloping my sign in option with tab pages. But if i style the body this directly affect websitSidepanel as maini'm trying to trigger Plasmo SidePanel when user clicks on the extension icon. but i can't get it toMUI styles with PlasmoGetInlineAnchorListStyles are added only for last shadow-root. Please tell me how to make it work. // Plasmo import cTypescript ConfusionI am working on a very simple extension that collects some data off the page and stores it locally. Proxy authentication and API calls afterwardHello, guys. I'm starting to give up. I'm developing proxy extension and proxying works okay. But how do you get a privacy policy when uploading to chrome web store?Most generators that I have searched for online require a link to your website to put in, but since await not definedhey! just trying out the basic extension framework using `create plasmo`. had the basics working, buLogging user errorsAnyone have any suggestions on any libraries or strategies that you use to log errors coming from usNo styling for options.tsxI have a basic options page written in TypeScript and styled via Tailwind CSS that displays perfectlShadcn dosnt seem to work in content script uiI have been trying to get Shadcn to work with CSUI. I followed almost everything from this server aswith-message exampleHow can I get with-message example to fully work? Including communication between tabs and content wHow to mock storageHey guys, im fairly new with plasmo. currently writing e2e tests with playwright. How can i properlytab page works with pnpm run dev but is blocked when i run pnpm build and pnpm packageWhen I upload my zipfile to plasmo itero, none of my users can access the tab page. however It workssupport for multiple assetstrying to do a simple toggle icon extension (click extension to toggle icon) but it seems like only Supabase url and anon key exposedI am a newbie exploring Plasmo for supabase authentication. The public url and anon keys are added iSupabase url and anon key exposedI am a newbie exploring Plasmo for supabase authentication. The public url and anon keys are added iFirefox dev server manifest warningsThe ```json { "content_security_policy": { "extension_pages": "script-src 'self' http://localhimport url no longer workingHey folks 👋🏻 just upgraded our extension at Attio to the latest version of Plasmo (0.85). It seems