Skip to content

Commit 91d097e

Browse files
david-gomeyjustin808
authored andcommitted
Avoid check old webpack versions (#66)
If someone wants to use older webpack versions, can download older versions of loader.
1 parent 2c0271e commit 91d097e

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/loader.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,10 @@ module.exports = function(source) {
2121

2222
logger.debug(`Hey, we're in DEBUG mode! Yabba dabba doo!`);
2323

24-
// TODO: Remove `webpack.options.sassResources` support after first stable webpack@2 release
25-
const isModernWebpack = webpack.version >= 2;
26-
const resourcesFromConfig =
27-
isModernWebpack
28-
? (loaderUtils.getOptions(this) || {}).resources
29-
: webpack.options.sassResources;
24+
const resourcesFromConfig = (loaderUtils.getOptions(this) || {}).resources;
3025

3126
if (!resourcesFromConfig) {
32-
const error = new Error(`
33-
Can't find sass resources in your config.
34-
Make sure ${isModernWebpack ? 'loader.options.resources' : 'webpackConfig.sassResources'} exists.
35-
`);
27+
const error = new Error('Can\'t find sass resources in your config. Make sure loader.options.resources exists');
3628

3729
return callback(error);
3830
}

test/index.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ describe(`sass-resources-loader`, () => {
8787
}],
8888
},
8989
}, (err) => {
90-
expect(err.message).toMatch(/Can\'t find sass resources in your config/);
91-
expect(err.message).toMatch(/Make sure loader.options.resources exists/);
90+
expect(err.message).toMatch(/Can\'t find sass resources in your config. Make sure loader.options.resources exists/);
9291
done();
9392
});
9493
});

0 commit comments

Comments
 (0)