Skip to content

Commit ea162ce

Browse files
authored
feat(asset): add ?inline and ?no-inline queries to control inlini… (#1695)
resolve #1689 vitejs/vite@9162172 の反映です。
1 parent 010ccca commit ea162ce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

guide/assets.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ import workletURL from 'extra-scalloped-border/worklet.js?url'
5555
CSS.paintWorklet.addModule(workletURL)
5656
```
5757

58+
### 明示的なインライン処理
59+
60+
アセットは、`?inline` または `?no-inline` 接尾辞を使用することで、それぞれインラインまたは非インラインで明示的にインポートできます。
61+
62+
```js twoslash
63+
import 'vite/client'
64+
// ---cut---
65+
import imgUrl1 from './img.svg?no-inline'
66+
import imgUrl2 from './img.png?inline'
67+
```
68+
5869
### アセットを文字列としてインポートする {#importing-asset-as-string}
5970

6071
アセットは末尾に `?raw` を付与することで文字列としてインポートすることができます。

0 commit comments

Comments
 (0)