[Feature]: support `?raw` for ts
What problem does this feature solve?
import LODASH_array from '@types/lodash/common/array.d.ts?raw';
I want to return a string
What does the proposed API look like?
As intuition suggests, any file should only return a string after concatenating this suffix The current situation is that this suffix function only supports files other than ts like 'txt' etc....
you could try use tools.rspack or tools.bundlerChain to support resourceQuery like svgr plugin
https://rsbuild.dev/plugins/list/plugin-svgr#svgroptionsexporttype https://github.com/web-infra-dev/rsbuild/tree/main/packages/plugin-svgr
see https://github.com/web-infra-dev/rsbuild/issues/3070
could you add enforce: 'pre' to your rule? @ouzhou
I tried all the parameters of enforce from the beginning
import str from "!./myType.ts?raw";
add ! can reslove this , but use ! is not a intuitive writing style
Without this feature, I find it difficult to migrate painlessly from vite https://vitejs.dev/guide/assets.html#importing-asset-as-string
我主动为“?raw”结尾的链接添加了“!”,折中的实现了和vite类似的效果
This feature will be tracked here: https://github.com/web-infra-dev/rsbuild/issues/3778
Closed as duplicate.