question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_Underscored files are being compiled in v5 rc1

See original GitHub issue

Up until version 4, SCSS files starting with an underscore hadn’t been compiled by themselves. v5 rc1 now compiles the corresponding files (in my case .min.css and .css) for the partial ones when I save one of them.

Project structure (example) _basics.scss style.scss (importing the _basics.scss in the beginning: @import 'basics';)

Previous behaviour Saving _basics.scss only triggers a save of style.scss and a compilation of the CSS files for it if it is open (if I am not mistaken), no _basics.css or _basics.min.css are created.

Current behaviour Saving _basics.scss triggers a compilation of CSS Files for it, e.g. _basics.css or _basics.min.css, and triggers errors because the single imported files with underscores only work in tandem with each other when imported into the styles.scss.

Edit: This is the file structure:

-- css\
    -- _basics.scss
    -- style.scss
    -- style.css // Obviously the output file
    -- style.min.css // Compressed output file

These are my settings:

"liveSassCompile.settings.formats": [
	{
	"format": "expanded",
	"extensionName": ".css",
	"savePath": null
	},
	{
	"format": "compressed",
	"extensionName": ".min.css",
	"savePath": null
	}
],
"liveSassCompile.settings.autoprefix": false,
"liveSassCompile.settings.watchOnLaunch": true,
"liveSassCompile.settings.excludeList": [
	".vscode/**",
	"wp-admin/**",
	"wp-includes/**",
	"wp-content/plugins/**",
	"wp-content/languages/**",
	"wp-content/uploads/**",
	"wp-content/upgrade/**"
],
"liveSassCompile.settings.includeItems": [
	"wp-content/themes/**/css/*.scss",
	"**/wp-content/themes/**/css/*.scss",
],

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
glenn2223commented, Apr 3, 2021

I’ll try this tomorrow when I have a longer moment for this.

Thanks, and there’s no rush. I just appreciate the time you’re taking to help out.

When I save the style.scss file, only the style.css and the style.min.css are being generated - like it should be. If I save any of the other mentioned underscored files, the files for _print.scss and _variables.scss are always being compiled, even if I save the _basics.scss or maybe the _fonts.scss - it always generates the compiled files for _print and _variables (with error messages, as they can’t operate on their own).

I’ll expand my test and see if I can replicate

Any idea how the transition to rc1 could cause this phenomenon?

v5 has had a massive overhaul. Part of that was a transition from the glob package to the fdir package (massive speed boost). It may be that fdir behaves slightly different in some way that I haven’t accounted for. Or I’ve made a mistake somewhere in the 1,000 code changes that have been made between v4.4.1 and v5 😁

0reactions
glenn2223commented, Apr 4, 2021

Wow, you got that one sorted quickly.

Yeah, as soon as I saw those lines I knew where I’d gone wrong

Have some nice holidays!

Thank you. You too

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why put in front of the file name "_" or "_" in scss/css?
The _ (underscore) is a partial for scss. That means the stylesheet its going to be imported (@import) to a main stylesheet i.e....
Read more >
Usage of _ (underscore) in _*.scss filenames #1283 - GitHub
Files beginning with an underscore won't be compiled stand-alone and therefore don't generate any file in dist .
Read more >
Naming Conventions — Elixir v1.15.0-dev - HexDocs
Due to this property, Elixir relies on functions starting with underscore to attach compile-time metadata to modules. Such functions are most often in...
Read more >
Learning the Basics - Gradle User Manual
What are dependency configurations. Every dependency declared for a Gradle project applies to a specific scope. For example some dependencies should be used...
Read more >
Build System (Legacy GNU Make) - ESP32 - — ESP-IDF ...
Overriding this list allows you to exclude source files in COMPONENT_SRCDIRS that would otherwise be compiled. See Specifying source files.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found