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
{{ message }}
This repository was archived by the owner on Jan 31, 2025. It is now read-only.
@@ -69,7 +69,7 @@ See [node-sass](https://github.com/andrew/node-sass) for all available options.
69
69
70
70
### Imports
71
71
72
-
webpack provides an [advanced mechanism to resolve files](http://webpack.github.io/docs/resolving.html). The sass-loader uses node-sass' custom importer feature to pass all queries to the webpack resolving engine. Thus you can import your sass-modules from `node_modules`. Just prepend them with a `~` which tells webpack to look-up the [`modulesDirectories`](http://webpack.github.io/docs/configuration.html#resolve-modulesdirectories)
72
+
webpack provides an [advanced mechanism to resolve files](http://webpack.github.io/docs/resolving.html). The sass-loader uses node-sass' custom importer feature to pass all queries to the webpack resolving engine. Thus you can import your sass-modules from `node_modules`. Just prepend them with a `~` which tells webpack to look-up the [`modulesDirectories`](http://webpack.github.io/docs/configuration.html#resolve-modulesdirectories).
73
73
74
74
```css
75
75
@import"~bootstrap/less/bootstrap";
@@ -95,9 +95,14 @@ module.exports = {
95
95
};
96
96
```
97
97
98
-
### Importing across language styles
98
+
### Problems with `url(...)`
99
99
100
-
Importing a file written in the other language style, like importing a `.sass` file from a `.scss` file, requires the file extension to be set explicitly. If no extension is specified, the extension is inherited from the importing file.
100
+
Since Sass/[libsass](https://github.com/sass/libsass) does not provide [url rewriting](https://github.com/sass/libsass/issues/532), all linked assets must be relative to the output.
101
+
102
+
- If you're just generating CSS without passing it to the css-loader, it must be relative to your web root.
103
+
- If you pass the generated CSS on to the css-loader, all urls must be relative to the entry-file (e.g. `main.scss`).
104
+
105
+
Library authors usually provide a variable to modify the asset path. [bootstrap-sass](https://github.com/twbs/bootstrap-sass) for example has an `$icon-font-path`. Check out [this example](https://github.com/jtangelder/sass-loader/tree/master/test/bootstrapSass).
0 commit comments