diff --git a/index.js b/index.js index 1752477..b193dbd 100644 --- a/index.js +++ b/index.js @@ -2,9 +2,9 @@ let parse = require('./src/parser').parse; let loaderUtils = require('loader-utils'); -module.exports = function(source) { +module.exports = function(source, map) { this.cacheable(); const config = loaderUtils.getLoaderConfig(this, 'requirejsPlugins'); - return parse(source, config.plugins); + return this.callback(null, parse(source, config.plugins), map); } diff --git a/test/index.spec.js b/test/index.spec.js index a3614a2..b67a9a8 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -7,6 +7,7 @@ describe('loader', () => { let cacheableCalled = false; let loaderContext = { cacheable: () => { cacheableCalled = true }, + callback: (context, source, map) => { return source }, options: { requirejsPlugins: { plugins: ['plugin']