Skip to content

Commit 4b8dc8b

Browse files
laSinteZatinux
authored andcommitted
Actualize info about css-loader (nuxt#785)
Due to upgrade of CSS loader and my issue nuxt/nuxt#3931 I think we should update documentation so we don't mislead newcomers
1 parent b67d00a commit 4b8dc8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

en/guide/assets.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ For example, we have this file tree:
1818
----| index.vue
1919
```
2020

21-
In your CSS, if you use `url('~/assets/image.png')`, it will be translated into `require('~/assets/image.png')`.
21+
In your CSS, if you use `url('~assets/image.png')`, it will be translated into `require('~/assets/image.png')`.
2222

23-
> Note that `~assets` (without a slash) won't work because `~` is a special indicator in `css-loader` and will be resolved to [modules](https://github.com/css-modules/css-modules).
23+
> Note that starting from Nuxt 2.0 due to css-loader upgradation you should use `~assets` (without a slash) in <url> CSS data type, e.g., background: url("~assets/banner.svg")
2424
2525
Or if in your `pages/index.vue` you use:
2626

0 commit comments

Comments
 (0)