-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Update runtime
test field in WebPack config to support Windows
#50727
Merged
SantosGuillamot
merged 1 commit into
trunk
from
fix/interactivity-runtime-build-in-windows
May 18, 2023
Merged
Update runtime
test field in WebPack config to support Windows
#50727
SantosGuillamot
merged 1 commit into
trunk
from
fix/interactivity-runtime-build-in-windows
May 18, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SantosGuillamot
added
the
[Feature] Interactivity API
API to add frontend interactivity to blocks.
label
May 18, 2023
gziolo
added
[Type] Build Tooling
Issues or PRs related to build tooling
[Type] Bug
An existing feature does not function as intended
labels
May 18, 2023
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
gziolo
approved these changes
May 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That aligns with all occurrences of /
in the test
value. I also see we use the same syntax in one more place:
test: /[\\/]style(\.module)?\.(pc|sc|sa|c)ss$/, |
It should be good. It still builds correctly on macOs.
Thanks for the review, Greg! 🙂 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Interactivity API
API to add frontend interactivity to blocks.
[Type] Bug
An existing feature does not function as intended
[Type] Build Tooling
Issues or PRs related to build tooling
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Update the
test
field in the WebPack config that is building the runtime file for the Interactivity API to support Windows.Why?
As explained in this warning in WebPack docs: "When files paths are processed by webpack, they always contain / on Unix systems and \ on Windows. That's why using [\/] in {cacheGroup}.test fields is necessary to represent a path separator. / or \ in {cacheGroup}.test will cause issues when used cross-platform."
How?
Using
[\\/]
for all the separators seems to fix the problem for Windows and it still works in other OS.Testing Instructions
Before this change
In a Windows machine, run
npm run build
command and check that insidebuild/block-library/interactivity
theruntime.js
file (and minified ones) ARE NOT there.After this change
In a Windows machine, run
npm run build
command and check that insidebuild/block-library/interactivity
theruntime.js
file (and minified ones) ARE there.We can also check that in other OS it keeps working as expected.