Skip to content

Commit

Permalink
fix(loader): Use lodash inside the loader directly
Browse files Browse the repository at this point in the history
Stop using webpack module rules inside the loader to get rid of the babel 500kb warning

fix #786
  • Loading branch information
jantimon committed Mar 25, 2018
1 parent 24f8acc commit b19204c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b19204c

Please sign in to comment.