Skip to content

Commit

Permalink
doc fixes (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Harris authored Apr 23, 2021
1 parent 92d3391 commit 7bfb715
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
7 changes: 4 additions & 3 deletions documentation/faq/45-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ question: How do I hash asset file names for caching?

You can have Vite process your assets by importing them as shown below:

```
```html
<script>
import imageSrc from '$lib/assets/image.png';
import imageSrc from '$lib/assets/image.png';
</script>
<img src={imageSrc} />

<img src="{imageSrc}" />
```
20 changes: 10 additions & 10 deletions documentation/faq/50-aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ In `svelte.config.cjs` add [`vite.resolve.alias`](https://vitejs.dev/config/#res
// svelte.config.cjs
const path = require('path');
module.exports = {
kit: {
vite: {
resolve: {
alias: {
'$utils': path.resolve('./src/utils')
}
}
}
}
kit: {
vite: {
resolve: {
alias: {
$utils: path.resolve('./src/utils')
}
}
}
}
};
```

In `tsconfig.json` (for TypeScript users) or `jsconfig.json` (for JavaScript users) to make VS Code aware of the alias:

```json
```js
{
"compilerOptions": {
"paths": {
Expand Down
2 changes: 1 addition & 1 deletion documentation/faq/80-integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please see [sveltejs/integrations](https://github.com/sveltejs/integrations#svel

### How do I use Babel, CoffeeScript, Less, PostCSS / SugarSS, Pug, scss/sass, Stylus, TypeScript, `global` styles, or replace?

Adding [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess) to your [`svelte.config.cjs](#configuration) is the first step. For many of the tools listed above, you only need to install the corresponding library such as `npm install -D sass`or `npm install -D less`. See the svelte-preprocess docs for full details.
Adding [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess) to your [`svelte.config.cjs`](#configuration) is the first step. For many of the tools listed above, you only need to install the corresponding library such as `npm install -D sass`or `npm install -D less`. See the svelte-preprocess docs for full details.

Also see [the examples above](/faq#how-do-i-use-x-with-sveltekit-how-do-i-setup-library-x) of setting up these and similar libraries.

Expand Down

0 comments on commit 7bfb715

Please sign in to comment.