Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dll] run babel on all modules that aren't explicitly excluded #59923

Closed
wants to merge 2 commits into from
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