You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/content/assets.md
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -40,14 +40,15 @@ This will typically look like: `<link data-trunk rel="{type}" href="{path}" ..ot
40
40
-`data-integrity`: (optional) the `integrity` digest type for code & script resources. Defaults to plain `sha384`.
41
41
-`data-wasm-no-import`: (optional) by default, Trunk will generate an import of functions exported from Rust. Enabling this flag disables this feature. Defaults to false.
42
42
-`data-wasm-import-name`: (optional) the name of the global variable where the functions imported from WASM will be available (under the `window` object). Defaults to `wasmBindings` (which makes them available via `window.wasmBindings.<functionName>`).
43
+
-`data-target-path`: (optional) Path where the output is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
43
44
44
45
## sass/scss
45
46
46
47
✅ `rel="sass"` or `rel="scss"`: Trunk uses the official [dart-sass](https://github.com/sass/dart-sass) for compilation. Just link to your sass files from your source HTML, and Trunk will handle the rest. This content is hashed for cache control. The `href` attribute must be included in the link pointing to the sass/scss file to be processed.
47
48
48
49
-`data-inline`: (optional) this attribute will inline the compiled CSS from the SASS/SCSS file into a `<style>` tag instead of using a `<link rel="stylesheet">` tag.
49
50
-`data-integrity`: (optional) the `integrity` digest type for code & script resources. Defaults to plain `sha384`.
50
-
-`data-target-path`: (optional) Path where the directory is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
51
+
-`data-target-path`: (optional) Path where the output is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
51
52
52
53
## css
53
54
@@ -56,22 +57,22 @@ This will typically look like: `<link data-trunk rel="{type}" href="{path}" ..ot
56
57
- In the future, Trunk will resolve local `@imports`, will handle minification (see [trunk#7](https://github.com/trunk-rs/trunk/issues/7)), and we may even look into a pattern where any CSS found in the source tree will be bundled, which would enable a nice zero-config "component styles" pattern. See [trunk#3](https://github.com/trunk-rs/trunk/issues/3) for more details.
57
58
-`data-integrity`: (optional) the `integrity` digest type for code & script resources. Defaults to plain `sha384`.
58
59
-`data-no-minify`: (optional) by default, CSS files are minified in `--release` mode (unless building with `--no-minification`). Setting this attribute disables minification for that particular file. Defaults to false.
59
-
-`data-target-path`: (optional) Path where the directory is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
60
+
-`data-target-path`: (optional) Path where the output is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
60
61
61
62
## tailwind
62
63
63
64
✅ `rel="tailwind-css"`: Trunk uses the official [tailwindcss cli](https://tailwindcss.com/blog/standalone-cli) for compilation. Just link to your tailwind css files from your source HTML, and Trunk will handle the rest. This content is hashed for cache control. The `href` attribute must be included in the link pointing to the sass/scss file to be processed.
64
65
65
66
-`data-inline`: (optional) this attribute will inline the compiled CSS from the tailwind compilation into a `<style>` tag instead of using a `<link rel="stylesheet">` tag.
66
67
-`data-integrity`: (optional) the `integrity` digest type for code & script resources. Defaults to plain `sha384`.
67
-
-`data-target-path`: (optional) Path where the directory is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
68
+
-`data-target-path`: (optional) Path where the output is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
68
69
69
70
## icon
70
71
71
72
✅ `rel="icon"`: Trunk will copy the icon image specified in the `href` attribute to the `dist` dir. This content is hashed for cache control.
72
73
73
74
-`data-integrity`: (optional) the `integrity` digest type for code & script resources. Defaults to plain `sha384`.
74
-
-`data-target-path`: (optional) Path where the directory is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
75
+
-`data-target-path`: (optional) Path where the output is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
75
76
76
77
## inline
77
78
@@ -86,13 +87,13 @@ This will typically look like: `<link data-trunk rel="{type}" href="{path}" ..ot
86
87
87
88
✅ `rel="copy-file"`: Trunk will copy the file specified in the `href` attribute to the `dist` dir. This content is copied exactly, no hashing is performed.
88
89
89
-
-`data-target-path`: (optional) Path where the directory is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
90
+
-`data-target-path`: (optional) Path where the output is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
90
91
91
92
## copy-dir
92
93
93
94
✅ `rel="copy-dir"`: Trunk will recursively copy the directory specified in the `href` attribute to the `dist` dir. This content is copied exactly, no hashing is performed.
94
95
95
-
-`data-target-path`: (optional) Path where the directory is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
96
+
-`data-target-path`: (optional) Path where the output is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
96
97
97
98
# Script Asset Types
98
99
@@ -111,7 +112,7 @@ This will typically look like: `<script data-trunk src="{path}" ..other options
111
112
Trunk will copy script files found in the source HTML without content modification. This content is hashed for cache control. The `src` attribute must be included in the script pointing to the script file to be processed.
112
113
113
114
-`data-no-minify`: (optional) by default, scripts are minified in `--release` mode (unless building with `--no-minification`). Setting this attribute disables minification for that particular file. Defaults to false.
114
-
-`data-target-path`: (optional) Path where the directory is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
115
+
-`data-target-path`: (optional) Path where the output is placed inside the dist dir. If not present, the directory is placed in the dist root. The path must be a relative path without `..`.
0 commit comments