Skip to content

Commit

Permalink
fix sass url loader (#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeMoorJasper authored and devongovett committed Aug 23, 2018
1 parent ffef2c1 commit 6ef0786
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/assets/SASSAsset.js
Expand Up @@ -40,13 +40,6 @@ class SASSAsset extends Asset {
? opts.indentedSyntax
: type === 'sass';

opts.functions = Object.assign({}, opts.functions, {
'url($url)': url => {
let filename = this.addURLDependency(url.getValue());
return new sass.types.String(`url(${JSON.stringify(filename)})`);
}
});

opts.importer = opts.importer || [];
opts.importer = Array.isArray(opts.importer)
? opts.importer
Expand Down Expand Up @@ -83,8 +76,7 @@ class SASSAsset extends Asset {
return [
{
type: 'css',
value: this.ast ? this.ast.css.toString() : '',
hasDependencies: false
value: this.ast ? this.ast.css.toString() : ''
}
];
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions test/integration/scss-url/index.scss
Expand Up @@ -6,3 +6,7 @@
.index {
background: url("http://google.com");
}

.something {
background: url(./image.jpeg);
}
5 changes: 5 additions & 0 deletions test/sass.js
Expand Up @@ -116,6 +116,11 @@ describe('sass', function() {
name: 'index.js',
assets: ['index.js', 'index.scss'],
childBundles: [
{
type: 'jpeg',
assets: ['image.jpeg'],
childBundles: []
},
{
type: 'map'
},
Expand Down

0 comments on commit 6ef0786

Please sign in to comment.