The file or directory does not exist: 'G:\Aframara Website\images' - ENOENT

Currently, I'm in the process of cleaning up the unused CSS in my website's style.css and bootstrap.min.css files during development. I am utilizing PostCSS and Parcel for this task.

After installing PostCSS and Parcel, I proceeded to create a postcss.config.js file.

Here is the code within the postcss.config.js file:

postcss.config.js

module.exports = {
    Plugins:[
        require("postcss-uncss")({
            html:[
             '/index.html'
            ]
        })
    ]
} 

However, when I run parcel index.html, I encounter the following error:

G:\Aframara Website\images\about\ us.jpg: ENOENT: no such file or directory, open 'G:\Aframara Website\images\about\ us.jpg'

My website consists of 7 HTML files, and apart from the aforementioned style.css and bootstrap.min.css files.

Hence, I am seeking efficient ways to reduce the size of these two files. I came across this informative video and followed the steps as demonstrated. Any additional suggestions would be greatly appreciated. Thank you.

Answer №1

After some research, I discovered a workaround by installing npm i -g purgecss

Following the installation, I made a new folder named 'purged' at the top level of my website.

Next, I executed the following command:

purgecss --css *.css **/*.css --content *.html *.js --output purged

This command generated two new files named style.css and bootstrap.min.css in the 'purged' folder.

Subsequently, I updated the CSS stylesheet URLs from css/bootstrap.min.css to purged/bootstrap.min.css and css/style.css to purged/style.css

The inclusion of *.js in the command helped identify any dynamically generated styles from javascript.

As a result of this optimization, the file sizes of bootstrap.min.css and style.css were significantly reduced.

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

Is it truly necessary to remove packages from devDependencies to improve performance?

It is a common understanding that packages listed under devDependencies are typically not included in the final build. So why do we remove them for the sake of performance optimization? For instance, there are discussions about replacing Moment.js with a ...

Get the div to occupy the rest of the available height

I am facing a challenge with two divs on my webpage. The bottom one contains content that expands the highest. The page is set to 100% height and width using the CSS property position: absolute. <style> body, html { height:100%, width:100% } ...

Error encountered when attempting to run the npm -v command

When running the npm -v command, I received the following message: 'CALL "C:\Program Files (x86)\nodejs\\node.exe" "C:\Program Files (x86)\nodejs\\node_modules\npm\bin\npm-cli.js&qu ...

Node.js CLI module failing to produce standard output

I've recently created a command line Node module where one of the tasks is to start up the server and log to the console. However, I have noticed that although the server starts up successfully, it fails to send any output to the console. #! /usr/bin ...

Tips for locating a file using javascript

My application scans a folder and displays all folders and HTML files inside it in a dropdown menu. It also shows any HTML files inside an iframe. There is one file named "highlighted.html" that should not appear in the dropdown menu, but if it exists in t ...

"Utilizing JavaScript, you can remove an element by clicking on the outer element within the

I need the functionality where, when a user clicks on an input type="checkbox", a corresponding textarea is displayed. Then, if the user clicks anywhere except for that specific textarea, it should be hidden. Can someone assist me with implementing this fe ...

Unable to install Npm on M1 Big Sur due to error message: "usr/lib/libcurl.dylib (No such file or directory)"

Encountering issues while attempting to clone my React web app on a new M1 Mac. Macbook Air M1 macOS Big Sur 11.4 Xcode is installed Experimented with different node versions using nvm Attempted installation of libcurl via Brew During npm install: npm WA ...

jQuery is not defined when importing reactjs, bootstrap, and npm modules

Having trouble using Bootstrap in my React app, as I keep getting an error message saying Error: Bootstrap's JavaScript requires jQuery. I've already imported jQuery and tried various solutions found in other posts like: import $ from 'jque ...

I can view this email signature correctly in VS Code and my browser, but all the other applications I've tried so far are unable to display it correctly

Simply put, I am facing an issue with my email signature. I use eM Client, while my client uses Outlook and I've also checked it in iCloud webmail. Surprisingly, none of these platforms display my email signature correctly, but VS Code and all my brow ...

The bootstrap navigation bar appears in a vertical orientation rather than the expected horizontal

My page is displaying the navbar vertically instead of horizontally. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1,shrink-to ...

Sidebar Masonry - Use Bootstrap for a Unique Layout

My goal is to have the page divided into 4 rows, with Masonry aligning the posts within 3 rows and a sidebar displayed on the right. However, I am facing an issue where Masonry mixes everything up and does not allow me to have a sidebar at the right. HTML ...

Create a Cutting-edge Navbar in Bootstrap 5.1 Featuring Three Distinct Sections: Left, Center, and Right

I'm encountering challenges with formatting the navbar layout I am currently designing. My goal is to create a navbar with three distinct sections as outlined in the title. In the first section on the left, there should be an image and a button-like ...

The Challenges of Parsing HTML Source Code for Web Scraping

I've been attempting to scrape data from this website: (specifically rare earth material prices) using Python and BeautifulSoup. My query pertains not to Python, but rather the HTML source code of the site. When I utilize Firefox's "Inspect Elem ...

Setting up browsershots for installation and activation

Recently, I attempted to configure Browsershots using the instructions provided on Github at https://github.com/spatie/browsershot. Here's an outline of the steps I followed: 1. Installed NodeJS and npm through yum 2. Installed Browsershots via Compo ...

Is it acceptable to place a <figure> tag inside a <header> tag within an <article>?

Imagine having this scenario: <article> <header> <h1>Article title</h1> <p>Article kicker</p> <figure> <img class="featured-image" src="http://article.com/featured/image. ...

Tips on creating a "CSS3 blink animation" using the visibility attribute

I'm attempting to create an old-school blink effect on some DIVs. They should start off as invisible and then quickly become visible for a moment, repeating this sequence in an infinite loop. According to CSS specifications, the "visible" property is ...

The functionality of the slick slider seems to be malfunctioning

I've been trying to integrate the slick slider into my website, but it just won't work. I've double-checked everything multiple times, but I can't seem to find the issue. It's driving me crazy! If anyone can help me identify the pr ...

What steps should I take to adjust the price when multiple items are chosen?

I am working on a school project that requires JavaScript programming assistance. You can view the code here: https://jsfiddle.net/zvov1jpr/3/ HTML: <script src="java.js"></script> <div id="formular"> <div id=&qu ...

What is the process for choosing the 1st, 4th, 7th element, and beyond?

Is there a way to choose the 1st, 4th, 7th elements and so on? Also, how can I select the 3rd, 6th, 9th, and beyond? The method involves selecting an element then skipping two before selecting the third one. I believe the :nth-child selector is the key bu ...

What is the best method for installing the most recent 1.1.5 version of is-callable?

After running the command npm install, an error occurred: npm ERR! code ETARGET npm ERR! notarget No matching version found for is-callable@^1.1.5. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a ...