Closed sibelius closed 4 years ago
it should not cause memory leak
it causes memory leak
cache-loader babel-loader usage
{ test: /\.(js|jsx|ts|tsx)?$/, exclude: [/node_modules/], // use: 'happypack/loader?id=js', use: ['cache-loader', 'babel-loader?cacheDirectory'], include: [srcPath, path.join(cwd, '../')], },
one optimization option that causes memory leak
optimization: { removeAvailableModules: false, removeEmptyChunks: false, splitChunks: false, }
another optimization option that causes memory leak (create 1 chunk per monorepo package)
const outModulesPrefix = 'entria'; const ourModulePattern = new RegExp(`^@${outModulesPrefix}\/([a-z]+[-[a-z]+]*)$`); splitChunks: { cacheGroups: { default: false, vendors: false, vendor: { name: 'vendor', chunks: 'all', test: /node_modules/, priority: 20, }, common: { name: module => `feedback-${module.rawRequest.match(ourModulePattern)[1]}`, minChunks: 1, chunks: 'all', maxAsyncRequests: Infinity, maxInitialRequests: Infinity, minSize: 0, maxSize: 1, test: module => ourModulePattern.test(module.rawRequest), priority: 10, enforce: true, }, }, },
try to use this babel-loader config with this optimization settings in a big codebase
Can't reproduce, problem still exists?
I will reopen when I got a better repro
@sibelius Feel free to ping me
Expected Behavior
it should not cause memory leak
Actual Behavior
it causes memory leak
Code
cache-loader babel-loader usage
one optimization option that causes memory leak
another optimization option that causes memory leak (create 1 chunk per monorepo package)
How Do We Reproduce?
try to use this babel-loader config with this optimization settings in a big codebase