include .js or .mjs files to output

Hi o7 I'm trying to build a project where I have .mjs files that are used to initalize worker threads (to import tsx/api/esm before importing the actual worker file if I'm running project in dev mode, etc.). But swc seems to not include them to output directory. How can I include these files to output directory?
5 Replies
kdy1
kdy1β€’2mo ago
You need to add them to CLI arguments manually
nowifi4u (Max) πŸ—• πŸ—— πŸ—™
all the files separately? no single option that can do that? the other issue is that I'm running swc from nest/cli so I dont think I can manipulate swc arguments directly
kdy1
kdy1β€’2mo ago
Only directory. If so you would need to invoke SWC by yourself What’s the single option you expect? Something like project mode of tsc?
nowifi4u (Max) πŸ—• πŸ—— πŸ—™
No some option like "include": ["src/**/*.mjs"], in tsconfig file that apart from building the project also copies the .mjs files
kdy1
kdy1β€’2mo ago
There’s no such option

Did you find this page helpful?