Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 10 additions & 34 deletions src/optimize/dynamic_dll_plugin/dll_config_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,41 +64,17 @@ function generateDLL(config) {
module: {
rules: [
{
resource: [
test: /\.js$/,
exclude: BABEL_EXCLUDE_RE.concat(dllNoParseRules),
use: [
{
test: /\.js$/,
exclude: BABEL_EXCLUDE_RE.concat(dllNoParseRules),
},
{
test: /\.js$/,
include: /[\/\\]node_modules[\/\\]x-pack[\/\\]/,
exclude: /[\/\\]node_modules[\/\\]x-pack[\/\\](.+?[\/\\])*node_modules[\/\\]/,
},
// TODO: remove when we drop support for IE11
// We need because normalize-url is distributed without
// any kind of transpilation
// More info: https://github.com/elastic/kibana/pull/35804
{
test: /\.js$/,
include: /[\/\\]node_modules[\/\\]normalize-url[\/\\]/,
exclude: /[\/\\]node_modules[\/\\]normalize-url[\/\\](.+?[\/\\])*node_modules[\/\\]/,
},
],
// Self calling function with the equivalent logic
// from maybeAddCacheLoader one from base optimizer
use: ((babelLoaderCacheDirPath, loaders) => {
return [
{
loader: 'cache-loader',
options: {
cacheContext: fromRoot('.'),
cacheDirectory: babelLoaderCacheDirPath,
readOnly: process.env.KBN_CACHE_LOADER_WRITABLE ? false : IS_KIBANA_DISTRIBUTABLE,
},
loader: 'cache-loader',
options: {
cacheContext: fromRoot('.'),
cacheDirectory: babelLoaderCacheDir,
readOnly: process.env.KBN_CACHE_LOADER_WRITABLE ? false : IS_KIBANA_DISTRIBUTABLE,
},
...loaders,
];
})(babelLoaderCacheDir, [
},
{
loader: 'thread-loader',
options: threadLoaderPoolConfig,
Expand All @@ -110,7 +86,7 @@ function generateDLL(config) {
presets: [BABEL_PRESET_PATH],
},
},
]),
],
},
{
test: /\.(html|tmpl)$/,
Expand Down