Skip to content

Commit c57cb87

Browse files
committed
fix: prevent lodash feature from using babel.config.js when compiling node_modules
1 parent 34ab29b commit c57cb87

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/internals/webpack/features/lodash.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// @flow
22

3+
import findCacheDir from 'find-cache-dir';
34
import fs from 'fs';
45
import path from 'path';
6+
import frameworkMetadata from '../../../shared/framework-metadata';
57
import BaseFeature from '../BaseFeature';
68
import type WebpackConfigBuilder from '../WebpackConfigBuilder';
79

@@ -38,7 +40,12 @@ export default class LodashFeature extends BaseFeature {
3840
exclude: [getLodashDir()],
3941
options: {
4042
babelrc: false,
43+
configFile: false,
4144
plugins: ['lodash', '@babel/plugin-syntax-dynamic-import'],
45+
cacheDirectory: `${findCacheDir({
46+
name: frameworkMetadata.name,
47+
})}/babel-lodash`,
48+
sourceType: 'unambiguous',
4249
},
4350
});
4451
}

0 commit comments

Comments
 (0)