webpack/test/hotCases/fake-update-loader.js

10 lines
288 B
JavaScript
Raw Normal View History

/** @type {import("../../").LoaderDefinition<{}, { updateIndex: number }>} */
module.exports = function (source) {
var idx = this.updateIndex;
2015-11-01 23:11:35 +08:00
var items = source.split(/---+\r?\n/g);
2018-06-26 00:39:59 +08:00
if (items.length > 1) {
this.cacheable(false);
}
2015-11-01 23:11:35 +08:00
return items[idx] || items[items.length - 1];
2018-06-26 00:39:59 +08:00
};