-
-
Notifications
You must be signed in to change notification settings - Fork 53
Copy uncompilable files (such as .proto) into dist library with bundleless #970
-
Hello! We're currently migrating from SWC to RSLib and were wondering if there were anyway to enable the SWC CLI option --copy-files? Or alternatively any other way to just copy the files over while not compiling them.
Beta Was this translation helpful? Give feedback.
All reactions
Oh, in bundleless mode, you can:
- Set
source.entryto remove files from the entry. - Set
output.copyto copy files to the output directory.
eg. https://lib.rsbuild.dev/guide/faq/features#how-to-skip-the-preprocessing-of-less--sass-files-in-bundleless-mode
Replies: 1 comment 8 replies
-
What bundle mode do you use?
Beta Was this translation helpful? Give feedback.
All reactions
-
You can use output.copy
Beta Was this translation helpful? Give feedback.
All reactions
-
@Timeless0911 Ah, sorry, I forgot to add that we have bundle: false in the two objects as well. I removed it as a workaround.
Beta Was this translation helpful? Give feedback.
All reactions
-
Does files you want to copy directly now being bundled into the output?
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh, in bundleless mode, you can:
- Set
source.entryto remove files from the entry. - Set
output.copyto copy files to the output directory.
eg. https://lib.rsbuild.dev/guide/faq/features#how-to-skip-the-preprocessing-of-less--sass-files-in-bundleless-mode
Beta Was this translation helpful? Give feedback.
All reactions
-
Sorry, I'll attempt to formulate my question a little better.
We don't want to bundle the app. We just want to copy the src/ folder with typescript (being transpiled) and other files (just being copied verbatim).
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks @Timeless0911! Worked like a charm!
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
export default defineConfig({ output: { sourceMap: true, copy: [{ from: '**/*.proto', context: path.join(__dirname, 'src') }], }, source: { entry: { index: ['./src/**', '!src/**/*.proto'], }, }, lib: [ { format: "esm", bundle: false, shims: { esm: { __dirname: true } }, dts: true, output: { distPath: { root: "./dist/esm" }, } }, { format: "cjs", bundle: false, dts: true, output: { distPath: { root: "./dist/cjs" }, } } ] });
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1