Skip to content

Commit 4f1ab08

Browse files
author
Jan Nicklas
committed
Cache loader result
1 parent 8e89ea2 commit 4f1ab08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

loader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ var loaderUtils = require('loader-utils');
33

44
module.exports = function (source) {
55
'use strict';
6+
if (this.cacheable) {
7+
this.cacheable();
8+
}
69
var allLoadersButThisOne = this.loaders.filter(function(loader) {
710
return loader.module !== module.exports;
811
});
@@ -11,9 +14,6 @@ module.exports = function (source) {
1114
return source;
1215
}
1316
// Use underscore for a minimalistic loader
14-
if (this.cacheable) {
15-
this.cacheable();
16-
}
1717
var options = loaderUtils.parseQuery(this.query);
1818
var template = _.template(source, options);
1919
return 'module.exports = ' + template;

0 commit comments

Comments
 (0)