mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Backports the following commits to 6.x: - Avoid unnecessary recompile at startup (#20176)
This commit is contained in:
parent
e75423e020
commit
73718c54fd
1 changed files with 14 additions and 1 deletions
|
@ -337,6 +337,19 @@ export default class BaseOptimizer {
|
|||
}
|
||||
};
|
||||
|
||||
const watchingConfig = {
|
||||
plugins: [
|
||||
new webpack.WatchIgnorePlugin([
|
||||
// When our bundle entry files are fresh they cause webpack
|
||||
// to think they might have changed since the watcher was
|
||||
// initialized, which triggers a second compilation on startup.
|
||||
// Since we can't reliably update these files anyway, we can
|
||||
// just ignore them in the watcher and prevent the extra compilation
|
||||
/bundles[\/\\].+\.entry\.js/,
|
||||
])
|
||||
]
|
||||
};
|
||||
|
||||
// in production we set the process.env.NODE_ENV and uglify our bundles
|
||||
const productionConfig = {
|
||||
plugins: [
|
||||
|
@ -361,7 +374,7 @@ export default class BaseOptimizer {
|
|||
? {}
|
||||
: transpileTsConfig,
|
||||
this.uiBundles.isDevMode()
|
||||
? supportEnzymeConfig
|
||||
? webpackMerge(watchingConfig, supportEnzymeConfig)
|
||||
: productionConfig
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue