diff --git a/CHANGELOG.md b/CHANGELOG.md index 8edb07b6b84..d0f9ab88751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Removed extra right side margin in `EuiSuperDatePicker` ([#2236](https://github.com/elastic/eui/pull/2236)) - Fixed incorrect `onClick` type for `EuiButtonEmpty` ([#2282](https://github.com/elastic/eui/pull/2282)) - Fixed compilation script to remove all TypeScript definition exports from built JS assets ([#2279](https://github.com/elastic/eui/pull/2279)) +- Fixed output extension for `dist` charts theme module ([#2294](https://github.com/elastic/eui/pull/2294)) ## [`13.7.0`](https://github.com/elastic/eui/tree/v13.7.0) diff --git a/scripts/compile-eui.js b/scripts/compile-eui.js index 22a458086cc..e42d713cb53 100755 --- a/scripts/compile-eui.js +++ b/scripts/compile-eui.js @@ -3,6 +3,7 @@ const chalk = require('chalk'); const shell = require('shelljs'); const path = require('path'); const glob = require('glob'); +const dtsGenerator = require('dts-generator').default; function compileLib() { shell.mkdir( @@ -43,7 +44,7 @@ function compileLib() { stdio: 'inherit', }); // validate the generated eui.d.ts doesn't contain errors - execSync(`tsc --noEmit -p tsconfig-builttypes.json`, { stdio: 'inherit' }); + execSync('tsc --noEmit -p tsconfig-builttypes.json', { stdio: 'inherit' }); console.log(chalk.green('✔ Finished generating definitions')); // Also copy over SVGs. Babel has a --copy-files option but that brings over @@ -74,11 +75,21 @@ function compileBundle() { console.log('Building chart theme module...'); execSync( - 'webpack src/themes/charts/themes.ts -o dist/eui_charts_theme.ts --output-library-target="commonjs" --config=src/webpack.config.js', + 'webpack src/themes/charts/themes.ts -o dist/eui_charts_theme.js --output-library-target="commonjs" --config=src/webpack.config.js', { stdio: 'inherit', } ); + dtsGenerator({ + name: '@elastic/eui/dist/eui_charts_theme', + out: 'dist/eui_charts_theme.d.ts', + baseDir: path.resolve(__dirname, '..', 'src/themes/charts/'), + files: ['themes.ts'], + resolveModuleId() { + return '@elastic/eui/dist/eui_charts_theme'; + } + }); + console.log(chalk.green('✔ Finished chart theme module')); } compileLib();