Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2e3d813

Browse files
committed
update docs
1 parent 70d676c commit 2e3d813

File tree

1 file changed

+33
-14
lines changed

1 file changed

+33
-14
lines changed

‎README.md‎

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,41 @@ import sass from 'sass';
1515
import dartSassRails from 'dart-sass-rails';
1616

1717
{
18-
loader: 'sass-loader',
19-
options: {
20-
sourceMap: true,
21-
implementation: sass,
22-
sassOptions: {
23-
functions: dartSassRails({
24-
assetRootPath: path.join(railsRoot, 'app', 'assets'),
25-
imagesPath: '/images',
26-
fontsPath: '/fonts',
27-
}),
28-
includePaths: [path.join(railsRoot, 'app', 'assets', 'stylesheets')],
18+
test: /\.(scss|sass|css)$/i,
19+
use: [
20+
MiniCssExtractPlugin.loader,
21+
{
22+
loader: "css-loader",
23+
options: {},
2924
},
30-
},
25+
{
26+
loader: "resolve-url-loader",
27+
28+
// Required if you use resolve-url-loader 3.0+
29+
options: {
30+
root: "",
31+
}
32+
},
33+
{
34+
loader: 'sass-loader',
35+
options: {
36+
sourceMap: true,
37+
implementation: sass,
38+
sassOptions: {
39+
functions: dartSassRails({
40+
assetRootPath: path.join(railsRoot, 'app', 'assets'),
41+
imagesPath: '/images',
42+
fontsPath: '/fonts',
43+
}),
44+
includePaths: [path.join(railsRoot, 'app', 'assets', 'stylesheets')],
45+
},
46+
},
47+
}
48+
]
3149
}
3250
```
3351

34-
### Inspired by
52+
### See also
3553

36-
This library is highly influenced by [node-sass-asset-functions](https://github.com/fetch/node-sass-asset-functions). If you are using node-sass, use that instead.
54+
- [node-sass-asset-functions](https://github.com/fetch/node-sass-asset-functions): dart-sass-rails is inspired by this lib. If you are using node-sass, use that instead.
55+
- [resolve-url-loader](https://github.com/bholloway/resolve-url-loader): should be used alongside with dart-sass-rails. Currently dart-sass-rails emits full file paths for `url()`, and resolve-url-loader transforms to proper urls.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /