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

[6.x] [build/ts] transpile public code with webpack-specific ts config (#21865) #21893

Merged
merged 1 commit into from
Aug 11, 2018

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Aug 10, 2018

Backports the following commits to 6.x:

…stic#21865)

Right now the build process is running TypeScript code through a single transpilation process which produces the JS code that ships with the distributable. This process causes problems because when running the optimizer from source we use a slightly different config https://github.com/elastic/kibana/blob/33c6ade75631fb3f56816bc134dff83d08f4f387/src/optimize/base_optimizer.js#L312-L313, which instructs typescript to build modules using ESM, which webpack understands, but in the build we transpile this TypeScript to commonjs, which does not support features that are important to the strategy we are using to maintain BWC with the legacy platform as we migrate to the new platform.

This implements a `tsconfig.browser.json` file at the root of the repository that extends the default `tsconfig.json` file and includes a `src/**/public/**/*` code, which the root `tsconfig.json` file now excludes. This new config file is added to the list of projects that we lint, is shared with webpack, and is built along with the default project in the build process to create JS code that uses esm for webpack to consume.
@elasticmachine
Copy link
Contributor

💔 Build Failed

@spalger
Copy link
Contributor Author

spalger commented Aug 10, 2018

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@spalger spalger merged commit 835ed85 into elastic:6.x Aug 11, 2018
@spalger spalger deleted the backport/6.x/pr-21865 branch August 11, 2018 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants