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

dist/eui_charts_theme should be .js #2294

Merged
merged 3 commits into from
Sep 6, 2019
Merged
Changes from 2 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
15 changes: 13 additions & 2 deletions scripts/compile-eui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down