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

fix(plugin-webpack): correctly define the asset relocator base dir #2022

Merged
merged 6 commits into from
Nov 25, 2020
Merged

fix(plugin-webpack): correctly define the asset relocator base dir #2022

merged 6 commits into from
Nov 25, 2020

Conversation

tjquillan
Copy link

@tjquillan tjquillan commented Nov 4, 2020

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:
Closes #1801 which appears to have been abandoned.

Fixes #1559.

@tjquillan tjquillan changed the title Webpack Fixes fix(plugin-webpack): definition of asset relocator base dir Nov 4, 2020
@tjquillan tjquillan changed the title fix(plugin-webpack): definition of asset relocator base dir fix(plugin-webpack): definition of asset relocator base dir (continuation) Nov 4, 2020
@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #2022 (28459da) into master (7e3227b) will increase coverage by 0.09%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2022      +/-   ##
==========================================
+ Coverage   72.65%   72.74%   +0.09%     
==========================================
  Files          74       74              
  Lines        2220     2220              
  Branches      420      420              
==========================================
+ Hits         1613     1615       +2     
- Misses        444      445       +1     
+ Partials      163      160       -3     
Impacted Files Coverage Δ
packages/plugin/webpack/src/WebpackConfig.ts 97.61% <ø> (+2.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e3227b...28459da. Read the comment docs.

@malept
Copy link
Member

malept commented Nov 25, 2020

This seems reasonable, feel free to write tests for this.

@tjquillan tjquillan marked this pull request as ready for review November 25, 2020 03:16
@malept
Copy link
Member

malept commented Nov 25, 2020

FYI the tests are failing on Windows due to differences in how paths are constructed.

@malept malept changed the title fix(plugin-webpack): definition of asset relocator base dir (continuation) fix(plugin-webpack): correctly define the asset relocator base dir Nov 25, 2020
This commit should fix the tests on windows. However, I did not have a
windows machine on me to test this.
@tjquillan
Copy link
Author

Thanks for catching that! I pushed a commit that should fix it but I did not have a windows machine to verify.

@malept
Copy link
Member

malept commented Nov 25, 2020

The tests expect the Windows paths' backslashes to be escaped.

@tjquillan
Copy link
Author

tjquillan commented Nov 25, 2020

Am I correct to assume this is what JSON.stringify is doing in assetRelocatorBaseDir?

Edit: Also, sorry for all this hassle.

@malept
Copy link
Member

malept commented Nov 25, 2020

Am I correct to assume this is what JSON.stringify is doing in assetRelocatorBaseDir?

Seems so:

> JSON.stringify('C:\foo')
'"C:\\foo"'

Turns out JSON.stringify escapes backslashes
Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

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

Thanks for finishing it up!

@malept malept merged commit 390219f into electron:master Nov 25, 2020
@tjquillan tjquillan deleted the webpack-fixes branch November 25, 2020 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants