diff --git a/lib/loader.js b/lib/loader.js index 58f9fba6..0adcd82d 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -38,7 +38,8 @@ module.exports = function (source) { 'webpackConfig', 'htmlWebpackPlugin' ]; - return 'var _ = require(' + loaderUtils.stringifyRequest(this, require.resolve('lodash')) + ');' + + // Require !!lodash - using !! will disable all loaders (e.g. babel) + return 'var _ = require(' + loaderUtils.stringifyRequest(this, '!!' + require.resolve('lodash')) + ');' + 'module.exports = function (templateParams) {' + // Declare the template variables in the outer scope of the // lodash template to unwrap them