Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

fix: Ensure that the webpack output filename ends with .js. #73

Merged
merged 2 commits into from
Apr 13, 2020

Conversation

jp7677
Copy link
Contributor

@jp7677 jp7677 commented Apr 10, 2020

This ensures that the Webpack SourceMapDevToolPlugin can handle the file, even when it has been originally no javascript file (e.g. .ts or .feature).

This should fix #68

@jp7677
Copy link
Contributor Author

jp7677 commented Apr 10, 2020

I'm not 100% percent sure that this is the correct fix, but it looks good and enables me to view and break into the original source. Let me know what you think.

@jp7677 jp7677 force-pushed the typescript-sourcemaps branch from c801f4a to 66f3d04 Compare April 10, 2020 08:00
@jp7677
Copy link
Contributor Author

jp7677 commented Apr 10, 2020

I'm seeing that I'm ending up with the compiled files in a new dist folder. So something isn't yet correct.

Edit: scratch that, was just small mistake on my side.

Copy link
Collaborator

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resolved value of the promise that's returned needs to equal the output path of the file. Since this currently only change's webpack's output and doesn't resolve with the new output path, Cypress won't know where to serve the file from.

If you add a new test that's a copy of this one, but with with a .ts file as the output path, I think you'll see it fail. Please add that test and then update the implementation so that it passes.

@jp7677
Copy link
Contributor Author

jp7677 commented Apr 10, 2020 via email

@jp7677 jp7677 force-pushed the typescript-sourcemaps branch 2 times, most recently from 9f1ea59 to ce80c80 Compare April 13, 2020 13:49
This ensures that the Webpack SourceMapDevToolPlugin can handle the file, even when it has been originally no javascript file (e.g. .ts or .feature).
@jp7677 jp7677 force-pushed the typescript-sourcemaps branch from ce80c80 to 10f9eda Compare April 13, 2020 13:50
@jp7677
Copy link
Contributor Author

jp7677 commented Apr 13, 2020

@chrisbreiding I've adjusted the PR, let me know if that fits.

@chrisbreiding chrisbreiding self-requested a review April 13, 2020 14:59
Copy link
Collaborator

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, @jp7677. This looks great and is a solid improvement.

@chrisbreiding chrisbreiding changed the title Ensure that the webpack output filename ends with .js. fix: Ensure that the webpack output filename ends with .js. Apr 13, 2020
@chrisbreiding chrisbreiding merged commit a6baf1f into cypress-io:master Apr 13, 2020
@chrisbreiding
Copy link
Collaborator

🎉 This PR is included in version 5.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

panzarino pushed a commit to cypress-io/cypress that referenced this pull request Sep 17, 2020
…io/cypress-webpack-preprocessor#73)

This ensures that the Webpack SourceMapDevToolPlugin can handle the file, even when it has been originally no javascript file (e.g. .ts or .feature).

Co-authored-by: Chris Breiding <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sources maps are not generated for typescript files
2 participants