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

Don't use tsconfig-paths-webpack-plugin if no baseUrl defined #322

Conversation

davidmfoley
Copy link
Contributor

We have a typescript project with no baseUrl defined in compilerOptions, which causes errors like the following when bundling:

Packaging [redacted] for stage staging (us-east-1)
Failed to load /[redacted]/tsconfig.json: Missing baseUrl in compilerOptions
Bundling with Webpack...
tsconfig-paths-webpack-plugin: Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin
tsconfig-paths-webpack-plugin: Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin
tsconfig-paths-webpack-plugin: Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin
...

This PR changes the webpack config to skip adding tsconfig-paths-webpack-plugin if no baseUrl is defined.

To test it, I added a flag to the runSlsCommand helper, that includes stderr output (as well as stdout) in the returned string.
You might want to do something different there but this seemed like the smallest possible change.

@jayair jayair added the bug Something isn't working label Aug 24, 2022
@jayair jayair merged commit d666903 into AnomalyInnovations:master Aug 24, 2022
@jayair
Copy link
Member

jayair commented Aug 24, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants