From 6ef0786e6e98e1d312cb675af917026d87ab4b56 Mon Sep 17 00:00:00 2001 From: Jasper De Moor Date: Thu, 23 Aug 2018 11:29:00 -0700 Subject: [PATCH] fix sass url loader (#1909) --- src/assets/SASSAsset.js | 10 +--------- test/integration/scss-url/image.jpeg | 0 test/integration/scss-url/index.scss | 4 ++++ test/sass.js | 5 +++++ 4 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 test/integration/scss-url/image.jpeg diff --git a/src/assets/SASSAsset.js b/src/assets/SASSAsset.js index 91ff52c0cb5..b62524bcd96 100644 --- a/src/assets/SASSAsset.js +++ b/src/assets/SASSAsset.js @@ -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 @@ -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() : '' } ]; } diff --git a/test/integration/scss-url/image.jpeg b/test/integration/scss-url/image.jpeg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/integration/scss-url/index.scss b/test/integration/scss-url/index.scss index b958266cdc3..edb73882da6 100644 --- a/test/integration/scss-url/index.scss +++ b/test/integration/scss-url/index.scss @@ -6,3 +6,7 @@ .index { background: url("http://google.com"); } + +.something { + background: url(./image.jpeg); +} diff --git a/test/sass.js b/test/sass.js index 9d0f3dd73ff..3e76ed18754 100644 --- a/test/sass.js +++ b/test/sass.js @@ -116,6 +116,11 @@ describe('sass', function() { name: 'index.js', assets: ['index.js', 'index.scss'], childBundles: [ + { + type: 'jpeg', + assets: ['image.jpeg'], + childBundles: [] + }, { type: 'map' },