Is Live SASS Compiler generating unnecessary files?

Currently, I am in the process of learning how to integrate SASS into my web development projects. However, I am facing some challenges when it comes to properly compiling my .scss files into a single .css file.

Upon running sass --version in my terminal, I see 1.53.0 compiled with dart2js 2.17.3. I am using the Live Sass Compiler extension by Glenn Marks, and my settings.json file configuration is as follows:

{
  "liveSassCompile.settings.formats":[
     {
         "format": "expanded",
         "extensionName": ".css",
         "savePath": "/css"
     },
 ],
 "liveSassCompile.settings.excludeList": [
    "**/node_modules/**",
    ".vscode/**"
 ],
 "liveSassCompile.settings.generateMap": true,
 "liveSassCompile.settings.autoprefix": [
     "defaults"
 ]
}

Here is the structure of my current project directory: Current Project Directory Structure

My main issue revolves around the fact that when I click Watch Sass, not only the desired files main.css and main.css.map are output, but also index.css and index.css.map files are created. I am aiming to follow the 7-1 SASS Architecture and have created index.scss files within specific folders, each containing files from the directory, which will then be forwarded to main.scss.

Is there a way to prevent the creation of the extra files? I am considering exploring the use of npm, although I am not very familiar with it. If it proves to be more efficient in utilizing SASS compared to using a VS Code extension, I am willing to switch to that approach and abandon the extension altogether.

Thank you in advance for your assistance. I hope I have provided sufficient information!

Answer №1

Utilizing Dart sass means having a built-in compiler readily available All you have to do is execute the following command:

sass --watch sass/main.scss css/main.css

Answer №2

If you choose to continue using my extension, you have the option to specify a single file for output or watching by adjusting the

liveSassCompile.settings.includeItems
setting - as demonstrated below

{
    "liveSassCompile.settings.includeItems": [ "/path/to/main.scss" ]
}

Alternatively, a potentially more effective solution is to utilize a negative glob expression in the

liveSassCompile.settings.partialsList
to treat all other files as partials. In this case, saving any SASS file will trigger compilation of only your main.scss file

An illustration of this concept would be **/!(main).scss. The !() denotes the negative glob pattern, indicating that if the internal pattern matches, it should be disregarded.

For a live demonstration, visit . Follow the setup below

  • Copy and paste the above glob pattern into the main field
  • Click on "edit files" and paste the content below into the field
/myapp/main.scss
/myapp/partials/file1.scss
/myapp/other.scss
  • Click "apply" for the update, and everything except the main file should be highlighted in blue

Answer №3

The culprit in your issue lies within this one line. Make the following adjustment:

 "liveSassCompile.settings.generateMap": true,

Change it to:

 "liveSassCompile.settings.generateMap": false,

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The jQuery.addClass() function seems to be malfunctioning

I'm encountering an issue with the addClass() method. For some reason, it's not functioning properly in this scenario: https://jsfiddle.net/0g1Lvk2j/20/ If you scroll to the end and close the last box by clicking on the orange box, the orange b ...

Design a circular progress bar with a cut-off at the bottom

Does anyone have suggestions on how to create a circular progress bar with cropping at the bottom, similar to this example: PROGRESS BAR? I've been searching for a component like this but haven't had any luck. Any ideas, especially utilizing Mate ...

Facing challenges while troubleshooting React.js code using Visual Studio Code

I am currently working with an Express backend and React JS on the frontend. I'm trying to debug my React code using Visual Studio Code, but I keep encountering a grayed out breakpoint with the message "Breakpoint ignored because generated code not fo ...

On the initial page load, Magento is failing to load the CSS properly

I've been tinkering with the Magento website over at For some reason, the CSS on the Home page doesn't load initially, but it loads fine when you click on any other link like Products or Gallery. Any ideas why this might be happening? Thanks in ...

What method does nosotroshq.com use to achieve the navigation effect when hovering over a menu item?

Seeking advice from skilled individuals familiar with JQUERY: Can anyone explain the technique used by nosotroshq.com in their top navigation bar? Specifically, how do they create the slow animation when hovering over "ABOUT US"? Any insights would be ap ...

What is the best way to define Bootstrap 5's CSS variables with the :root selector?

I am working with a Bootstrap 5 application that utilizes various web components, all styled with Bootstrap 5. I am looking to dynamically customize the theme within the parent component that integrates these web components. The basic structure of my setup ...

Linking the location of the pop-up to the currently selected text box

I am currently experimenting with setting the top and left values relative to the selected_element (which is active at the time of triggering the popup) in a manner similar to a tooltip. I attempted to use $().position() in combination with jQuery, but it ...

Displaying Table Headers on Page Breaks in Laravel PDF with Webkit Technology

Let me provide some context: I am utilizing Laravel to generate a view that is then converted to a PDF using barryvdh/laravel-snappy with the help of wkhtmltopdf, and everything is functioning as expected. However, I am encountering difficulties in stylin ...

What is the best way to eliminate the curved border and inset box shadow from the Material UI TextField component in React?

Check out this input field: https://i.sstatic.net/Z6URV.png Notice the inner shadow and curved borders. Take a look at the given code snippet: import React, {Component} from 'react'; import TextField from 'material-ui/TextField'; im ...

Navigating conflicts between packages that utilize TypeScript can be tricky. Here are some strategies for handling these situations

I recently encountered an issue while following a tutorial to create a WhatsApp clone using Meteor. The tutorial link is here The problem arose at the end of section 8 when I executed the $meteor reset command as directed. However, upon running the $ n ...

Is it possible to distinguish CSS for varying input types?

Is it possible to style input type=text/radio/checkbox elements differently using CSS? I'm referring to ways other than just adding a class ...

The styled horizontal list item has a background color that is not covering the entire

After setting up my CSS, I noticed a discrepancy in how the background color behaves when hovering over links in the navigation versus links in the footer. While the entire "button" area is filled with the background color in the nav, only the space behind ...

Unleashing the power of Sass and CSS in your Next Js project

Trying to incorporate sass and css modules into my next.config.js has been challenging due to an error I keep encountering: Failed to compile. ./node_modules/@riskalyze/react-ui/node_modules/@riskalyze/calendar/assets/index.css Unknown word (1:1) > 1 ...

Encountering a problem executing a script in VSC because of a missing file or directory

Just starting out with VSC, I encountered an error when trying to run my c++ code in VSC. Any quick assistance would be greatly appreciated as I have an assignment due soon! Click here for a picture of the error. ...

modify CSS style once the modal has been hidden

Is there a way to change the default background color of my table row back to normal after closing the modal window that appears when I click on it? <tr class='revisions'> <td>{{ $revision->date_of_revision->format(' ...

There was an error on the Flipkart affiliate client node as it returned a 404 not found status

After running this code, I keep encountering an error 404. The code utilizes the flipkart-affiliate-client npm package for interacting with the Flipkart API (https://github.com/zivost/flipkart-affiliate-client) var flipkart = require('flipkart-affili ...

Concerns regarding the implementation of enums in Nest JS originating from the package

I'm struggling with using TypeScript enums in my Nest JS Application. Our project is set up as a monorepo (npm workspace) with multiple packages and apps. One of the packages includes shared types for both our frontend (Next JS) and backend. While th ...

Conceal certain digits of a credit card number in a masked format for security purposes

Is there a reliable method to mask Credit Card numbers in password format within a text field? **** **** **** 1234 If you are aware of a definitive solution, please share it with us. ...

Tips for utilizing numerous tables with multiple selection tags

I am struggling with a jQuery issue involving multiple container elements with the class "product-sizes". Each container contains a select option for choosing between inches and centimeters, which triggers the corresponding table display. The problem arise ...

Having an issue with the 'scroll' event not being disabled in jQuery

Currently, we are encountering an issue with the implementation of a simple hiding menu when scrolling and showing it back once the user stops scrolling. The method .on('scroll') works as expected, but .off('scroll') is not functioning ...