[chore] Tweak io-ts config on shared bundle (#217202)

## Summary

Save ~250kb out of thin air by tweaking the webpack configuration for
the `io-ts` package.
This commit is contained in:
Marco Liberati 2025-04-09 10:15:55 +02:00 committed by GitHub
parent 92a9f8531a
commit 99d6c85e02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -57,6 +57,9 @@ const externals = {
// this is how plugins/consumers from npm load monaco
'monaco-editor/esm/vs/editor/editor.api': '__kbnSharedDeps__.MonacoBarePluginApi',
'io-ts': '__kbnSharedDeps__.IoTs',
'io-ts/lib/Reporter': '__kbnSharedDeps__.IoTsReporter',
'io-ts/lib/PathReporter': '__kbnSharedDeps__.IoTsPathReporter',
'io-ts/lib/ThrowReporter': '__kbnSharedDeps__.IoTsThrowReporter',
'@reduxjs/toolkit': '__kbnSharedDeps__.ReduxjsToolkit',
'react-redux': '__kbnSharedDeps__.ReactRedux',
redux: '__kbnSharedDeps__.Redux',

View file

@ -31,6 +31,10 @@ export const Moment = require('moment');
export const MomentTimezone = require('moment-timezone/moment-timezone');
export const IoTs = require('io-ts');
export const IoTsReporter = require('io-ts/Reporter');
export const IoTsPathReporter = require('io-ts/PathReporter');
export const IoTsThrowReporter = require('io-ts/ThrowReporter');
export const KbnMonaco = require('@kbn/monaco');
export const MonacoBarePluginApi = require('@kbn/monaco').BarePluginApi;
export const React = require('react');