-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: resourceQuery not work in #3070
Comments
You'd use |
I'm transfering this issue to rsbuild as it pertains to rsbuild. I'm closing this issue as won't fix because it appears to be usage question, a suggestion has been provided and Please feel free to continue this discussion if you have any further question on it. -- BTW, |
Yeah, we can update the doc for this |
I don't think this is a document issue |
can we reopen this issue? |
If you want to get the TypeScript source code instead of the transformed JavaScript code, you should exclude the assets with export default defineConfig({
tools: {
rspack: {
module: {
rules: [
{
resourceQuery: /raw/,
type: 'asset/source',
},
],
},
},
bundlerChain(chain, { CHAIN_ID }) {
// add this line
chain.module.rule(CHAIN_ID.RULE.JS).resourceQuery({ not: /raw/ });
},
},
}); |
ok |
I never knew that webpack supported this, can you provide some references? |
vite |
webpack demo please download in your mac and https://stackblitz.com/edit/vitejs-vite-3kfqqu?file=src%2FmyType.ts |
|
please try |
You are right , it works So any plan to use
|
You may have confused a concept. CRACO and webpack are not tools of the same level. The demo you provided above is based on CRACO, not webpack. Rspack / Rsbuild is compatible with webpack, not all upper-level tools based on webpack. We cannot make Rsbuild compatible with the behaviors of all different tools. As for the |
Yes, craco is not the same level After testing, the result of webpack is consistent with rspack webpack need configure attempt to match the rules in these arrays, and once the match is successful, no further rules will be attempted maybe use oneOf to control the order of loaders |
From the document, it seems that as long as I configure it this way, no matter what file it is, as long as it is? The endings of raw should all be strings, and disabling the loader through hacking doesn't seem intuitive |
System Info
System:
OS: macOS 13.3
CPU: (10) arm64 Apple M2 Pro
Memory: 90.48 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
Yarn: 1.22.22 - ~/npm_global/bin/yarn
npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
pnpm: 8.6.3 - ~/npm_global/bin/pnpm
bun: 1.1.4 - ~/npm_global/bin/bun
Browsers:
Chrome: 126.0.6478.185
Edge: 127.0.2651.74
Safari: 16.4
Details
I want to import a ts type file to use as a string, to inject typing to monaco editor
The following code will report an error
i have tried enforce:'pre' and config.module!.noParse = /myType.ts/;
not work
Reproduce link
No response
Reproduce Steps
just run code
The text was updated successfully, but these errors were encountered: