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: CSS files don't build in dev mode on Windows #42041

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/packages/build.js
Expand Up @@ -116,7 +116,9 @@ function createStyleEntryTransform() {

packages.add( packageName );
const entries = await glob(
path.resolve( PACKAGES_DIR, packageName, 'src/*.scss' )
path
.resolve( PACKAGES_DIR, packageName, 'src/*.scss' )
.replace( /\\/g, '/' )
);
Copy link
Contributor Author

@t-hamano t-hamano Jun 29, 2022

Choose a reason for hiding this comment

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

I discovered that when I run npm run dev, createStyleEntryTransform function is executed and the CSS file stored in this entries variable is returned to stream.
However, this variable was empty on Windows OS.

As described in the fast-glob v3.0.0 release notes, I think the reason is that only forward slashes are allowed in regular expressions in globs, and slash replacement is no longer processed.

So I added the process of replacing backslashes with forward slashes.


// Account for the specific case where block styles in
Expand Down