Replies: 9 comments
-
switched to unplugin and it works perfectly |
Beta Was this translation helpful? Give feedback.
-
Can you provide a minimal demo? Thanks |
Beta Was this translation helpful? Give feedback.
-
sure, i added you as a collaborator, here is the repo: https://github.com/pot-code/rsbuild-vue-gen-routes |
Beta Was this translation helpful? Give feedback.
-
I didn't find api.transform related code in this repo. Rsbuild's transform API is implemented based on Rspack's loader, which means that after a module is processed by all matching loaders, it must eventually return a module that Rspack can parse (standard JavaScript or CSS). |
Beta Was this translation helpful? Give feedback.
-
because I tried it and it didn't work as I expected so its removed from the repo. so rsbuild plugin is not designed for low level processing I presume |
Beta Was this translation helpful? Give feedback.
-
Can you explain "low level processing" in more depth? |
Beta Was this translation helpful? Give feedback.
-
the ability to process raw file content without the interference of internal loaders |
Beta Was this translation helpful? Give feedback.
-
maybe it's a little late but thank you for listening. I have migrated to unplugin and it just works. rsbuild is an awesome building tool! I could use another way to supplement its functionalities and it's not a big deal |
Beta Was this translation helpful? Give feedback.
-
Thank you for your kind words! I will convert this issue to discussion to allow further discussions. |
Beta Was this translation helpful? Give feedback.
-
What problem does this feature solve?
I am currently developing a Vue custom macro plugin. This plugin scans Vue files for a specific macro definition, collects this information, and outputs it to a file. To ensure the code runs correctly, the macro code needs to be removed before
pluginVue()
is executed. When using the Rsbuild plugin API, I've found that Vue files must be processed byvue-loader
first.Therefore, can Rsbuild provide the capability to treat a file type as a regular file? I noticed that the
descriptor
configuration includes araw
option. Could this option serve as a switch to handle files as raw files?我现在正在开发一个 vue 自定义 marco 的插件,该插件会扫描 vue 里的某个 macro 定义,然后收集这些信息输出到某个文件里。为了让代码能正常运行,在 pluginVue 执行前需要将代码里的 marco 代码去除。现在我在用 rsbuild 的插件 api 时,发现 vue 文件必须先有 vue-loader 才能处理。
所以 rsbuild 能否提供将文件类型当做普通文件来处理的能力,我看到 descriptor 的配置包含
raw
选项,能否将该选项作为原始文件处理的开关?What does the proposed API look like?
I see that the
descriptor
configuration includes araw
option. Could this option serve as a switch to handle files as raw files?Beta Was this translation helpful? Give feedback.
All reactions