File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,9 @@ declare module '*?url' {
233
233
* @example
234
234
* import logo from './logo.svg?inline'
235
235
* console.log(logo) // 'data:image/svg+xml;base64,...'
236
+ *
237
+ * import inlineCss from './style.css?inline';
238
+ * console.log(inlineCss); // Compiled CSS content
236
239
*/
237
240
declare module '*?inline' {
238
241
const content : string ;
@@ -241,10 +244,17 @@ declare module '*?inline' {
241
244
242
245
/**
243
246
* Imports the raw content of the file as a string.
244
- * @note Only works for static assets and CSS files by default.
247
+ * @note Only works for static assets, CSS files, and scripts
248
+ * (JS, TS, JSX, TSX) by default.
245
249
* @example
246
250
* import raw from './logo.svg?raw'
247
251
* console.log(raw) // '<svg viewBox="0 0 24 24">...</svg>'
252
+ *
253
+ * import rawJs from './script.js?raw'
254
+ * console.log(rawJs) // 'console.log("Hello world");'
255
+ *
256
+ * import rawCss from './style.css?raw'
257
+ * console.log(rawCss) // 'body { background: red; }'
248
258
*/
249
259
declare module '*?raw' {
250
260
const content : string ;
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ Rsbuild supports importing compiled CSS files as strings in JavaScript by using
166
166
``` js
167
167
import inlineCss from ' ./style.css?inline' ;
168
168
169
- console .log (inlineCss); // Output the compiled CSS file content
169
+ console .log (inlineCss); // Compiled CSS content
170
170
```
171
171
172
172
Using ` import "*.css?inline" ` has the following behaviors:
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ Rsbuild 支持通过 `?inline` 查询参数引用 CSS 文件编译后的内容
166
166
``` js
167
167
import inlineCss from ' ./style.css?inline' ;
168
168
169
- console .log (inlineCss); // 输出编译后的 CSS 文件内容
169
+ console .log (inlineCss); // 编译后的 CSS 内容
170
170
```
171
171
172
172
使用 ` import "*.css?inline" ` 的行为如下:
You can’t perform that action at this time.
0 commit comments