Skip to content

Commit 7b4eb7f

Browse files
committed
fix(loader): Use lodash inside the loader directly
Stop using webpack module rules inside the loader to get rid of the babel 500kb warning fix #786
1 parent 24f8acc commit 7b4eb7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ module.exports = function (source) {
3838
'webpackConfig',
3939
'htmlWebpackPlugin'
4040
];
41-
return 'var _ = require(' + loaderUtils.stringifyRequest(this, require.resolve('lodash')) + ');' +
41+
// Require !!lodash - using !! will disable all loaders (e.g. babel)
42+
return 'var _ = require(' + loaderUtils.stringifyRequest(this, '!!' + require.resolve('lodash')) + ');' +
4243
'module.exports = function (templateParams) {' +
4344
// Declare the template variables in the outer scope of the
4445
// lodash template to unwrap them

0 commit comments

Comments
 (0)