Issue with Vue CLI 3: the hot reloading feature is causing significant delays in rebuilding the project

After updating a major project to utilize Vue CLI 3, I've noticed that the hot reloading process has become exceptionally slow:

  • Upon opening a .vue file, it automatically rebuilds without any prompt, taking up to 10-15 seconds each time
  • Whenever I save my work, there is another delay of 10-15 seconds before the changes take effect

This issue never occurred prior to integrating CLI 3. Could there be a caching mechanism that needs to be enabled or configured?

Answer №1

Sharing my experience for anyone facing the same issue. It turns out that the problem was related to how I was utilizing the style-resources-loader plugin, which enables SASS variables to be accessed globally.

I mistakenly believed that all styles needed to be loaded for the plugin to work properly, but in reality only the global styles we want to bind are necessary:

  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'scss',
      patterns: [
        path.resolve(__dirname, './src/shared/assets/styles/vars/_all.scss')
      ]
    }
  }

These files are regenerated every time a component is triggered, leading to long hot reloading times (especially considering the large amount of SCSS in this project).

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 functionality of this.clusterer is not defined when trying to add a marker using this.clusterer.addMarker(marker);

I'm encountering an error message that says this.clusterer is undefined. Below is an overview of my configuration. Expected behavior: The page should load, then AJAX-load the markers from the controller using the query defined in #search_form. Finall ...

Exploring an XML document with HTML

I have an XML file that is paired with an XSL file. The resulting output can be located here. I am working on creating an HTML webpage where users can input a search query, such as 'Year < 2009', into a search box. The table above will then d ...

In JavaScript, I would like to be able to input an end date and have the program calculate and display the number of days remaining until the deadline

I'm working on a school project that involves JavaScript code. I'm struggling with converting a date prompt from string to number format. As a beginner in JavaScript, I could really use some guidance. <script> enddate = prompt('Wh ...

What are the steps for reordering an array in MongoDB?

Is there a way to increase or decrease the position of an element within an array stored in a MongoDB object? I explored the <update> API in the MongoDB API, but couldn't find a direct method for this task. I am attempting to use findOneAndUpd ...

What is the most effective way to communicate to my client that attempting to conceal the browser toolbar is an ill-advised decision?

One of my clients has a friend who claims to be conducting 'security testing' and insists that the PHP Zend Framework application I developed for them should implement certain browser-side features: hide the location bar, toolbar, bookmarks, me ...

Is there a way to dynamically apply styles to individual cells in a React Table based on their generated values?

I'm having trouble customizing the style of a table using react table, specifically changing the background color of each cell based on its value. I attempted to use the getProps function in the column array as suggested by the react table API documen ...

Creating a JSON data structure from HTML markup

My goal is to generate a json object by extracting data from a specific section of a wiki page (link). In the "Contents" section, I aim to gather all the information and structure it into an object as follows: { Arts : { "Performing Arts" : [{"Music" : [ ...

Looking for a jQuery function to reload images?

I have a GIF image loading bar animation that I want to reload when the "Reload Image" button is clicked, so that the animation will repeat. //HTML <img src="http://i54.tinypic.com/2qdwtp0.gif" id="load-bar"/> <a href="#" id="reloadImg">Relo ...

Utilizing 'this' in jQuery: Image swapping with thumbnails, Twitter Bootstrap framework

Is it possible for jQuery's 'this' to simplify my code? You can view the full code here. Thank you for any help or suggestions. Here is the jQuery code: /* Ref: http://api.jquery.com/hover/ Calling $( selector ).hover( handlerIn, handler ...

Change the ng-model of the initial controller when a button is clicked in a separate controller

I am working on an AngularJS application that has two controllers. I am facing an issue where I need to update the ng-model of an input field in the first controller by clicking a button in the second controller. Accessing the $scope of the first controlle ...

Pass a variable from Vue JS to update a CSS property in real-time

Currently, I am working on a project for an online exams portal. https://i.sstatic.net/4ab7S.png This snippet represents a part of my code: <div class="" v-for="areas in knowledgeAreas"> {{areas.area}}<div class="progress" style="margi ...

Differences between Angular 4 and AngularJs directives

Delving into the world of Angular 4, I have encountered a slight hurdle in my understanding of directives. My goal is to create a directive that can resize an element based on its width. Back in the days of AngularJs, this task was accomplished with code r ...

unable to retrieve getters within the store module

This is the explanation of my store module. // rest defined earlier const _GETTERS = { getName: state => { return state.current.name; }, getLastName: state => { return state.current.lastName; }, getFullName: (state, getters) => ...

Adjusting the Connection header in a jQuery ajax request

I've been attempting to modify the Connection header using the code below, but so far, I haven't had any success jQuery.ajax({ url: URL, async: boolVariable, beforeSend: function(xhr) { xhr.setRequestHeader("Connection ...

I am puzzled as to why I keep receiving the error message "Unexpected token }"

Apologies for the syntax-related query, but after exhausting all my debugging efforts, I am unable to identify any errors. My current JavaScript file looks like this: $(function () { // equivalent to $(document).ready(function() { var snakeBoardHold ...

Conceal the block quotes while substituting with a newline

My HTML page contains numerous comments enclosed in blockquotes. I attempted to implement a feature that allows users to hide all the comments with just one click by using the following JavaScript code: const blockQuotes = document.getElementsByTagName(& ...

Callback function triggered upon the creation of a DOM node

I am in search of a way to have a specific callback function run each time a div that matches a particular selector is added to the DOM. I have explored the DOM events documentation and the event closest to what I need seems to be "load", however, it does ...

InsertOne function in MongoDB schema fails to add property during insertion operation

The issue has been resolved, thank you! Now, when I upload the document it appears in this format: { _id: "5e3b64b6655fc51454548421", todos: [ ], title: "title" } It should be formatted like this, as per the schema where the "title" property is listed ...

The issue with hiding and showing elements using JavaScript during drag and drop functionality

In my code, I have two boxes with IDs box1 and box2, These boxes can be dragged and dropped into the boxleft element, Upon dropping them, the background image is removed and only the name appears in the box, My issue is that when loading values into box ...

Select a random option from the dropdown menu

I have the following script: <script> function $(id) { return document.getElementById(id); } function getImage() { $('loader').src='/misc/images/loading.gif'; var url = "http://mouse ...