purgecss | When building a website , chances | Plugin library
kandi X-RAY | purgecss Summary
kandi X-RAY | purgecss Summary
Remove unused CSS
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of purgecss
purgecss Key Features
purgecss Examples and Code Snippets
Community Discussions
Trending Discussions on purgecss
QUESTION
I have a Nuxt ^2.15.8 application which is constantly reloading after I run yarn dev
.
The console will show a message like ↻ Updated 1647868577626
, and then the application is rebuilt, as if I just run yarn dev
. This happens constantly over and over, without me doing any changes in the code.
I googled a bit, and found applications like gitkraken might be modifying the content of the .git folder and that could trigger a reload.
So I keep gitkraken closed.
I also added these lines to my nuxt.config.js
file:
ANSWER
Answered 2022-Apr-03 at 10:40The actual issue was actually a version bump of ESlint from 1.x.x
to 3.x.x
. git bisect
helped finding out the actual culprit!
Cloning the repo again and reinstalling the dependencies again, fixed all the above mentioned issues while running yarn dev
!
QUESTION
I'm trying to replace the Tailwindcss compiler with @tailwindcss/jit in a Laravel project that is using Vue Laravel Mix but I'm getting this Unknown word error.
✖ Mix Compiled with some errors in 489.07ms
ERROR in ./resources/sass/app.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js): SyntaxError
(1:1) /Users/username-76/Desktop/projectname/resources/sass/app.scss Unknown word
1 | import api from "!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"; | ^ 2 | import content from "!!../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[3]!./app.scss"; 3 |
at processResult (/Users/username-76/Desktop/projectname/node_modules/webpack/lib/NormalModule.js:701:19) at /Users/username-76/Desktop/projectname/node_modules/webpack/lib/NormalModule.js:807:5 at /Users/username-76/Desktop/projectname/node_modules/loader-runner/lib/LoaderRunner.js:399:11 at /Users/username-76/Desktop/projectname/node_modules/loader-runner/lib/LoaderRunner.js:251:18 at context.callback (/Users/username-76/Desktop/projectname/node_modules/loader-runner/lib/LoaderRunner.js:124:13) at Object.loader (/Users/username-76/Desktop/projectname/node_modules/postcss-loader/dist/index.js:140:7)
1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details) webpack compiled with 2 errors
app.scss
...ANSWER
Answered 2021-Jul-30 at 19:30You're using the PostCSS plugin, yet you are attempting to compile SASS. Do it the following way instead.
QUESTION
I have spent three hours trying to debug this Gatsby build error.
It says to use a non-minified command, but gatsby develop
doesn't throw any error so I'm a bit unsure on how to debug this.
Looking online reveals very little for the /styles/
folder.
My Netlify server also throws the same error as well as failing locally on Mac.
Any suggestions on where to start?
...ANSWER
Answered 2022-Feb-03 at 12:47After having access to the repo (which runs on Gatsby) I found that /styles/
folder when searched was inside the /public/
folder which is generated by gatsby, this pointed me to the same error that referenced the chunk error "componentChunkName": "component---src-pages-styles-js"
, I then searched for this file which existed in the .cache
, this file showed me the error was coming from @emotion trying to compile the src/pages/styles.js
file that is used by index-old.js
.
It seemed that Gatsby was interpreting /src/pages/styles.js
as a normal static page to build, but because it is returning a function that returned emotion JSX it couldn't build properly as Gatsby expects all .js
files to return React JSX code.
It turned out in this project, these files wasn't actually used anymore so simply deleting them fixed the issue. If it was used though, simply having styles.js somewhere other than the /src/pages
folder would fix this. I'd recommend having a views
folder where you store all pages and styling relative to it to avoid Gatsby trying to compile pages from styling.
QUESTION
My goal is to eliminate render-blocking CSS and JS on a website.
Google suggests to identify the used CSS/JS via coverage, and move that code from the render-blocking URL to an inline script tag in your HTML page. When the page loads, it will have what it needs to handle the page's core functionality.
For example for core CSS:
...ANSWER
Answered 2022-Jan-24 at 09:53Take a look at https://github.com/pocketjoso/penthouse for extracting the 'critical' CSS for a page, this will then go in your tag.
I'd recommend then including all of your CSS in the CSS file via a link tag. This will mean it's the same on each page and can be cached by the browser.
QUESTION
I'm making this site using Next.JS hosted @ Vercel. One of the packages I'm using is a custom one that I've forked, updated it in my project and after the build, was able to make it work locally. I posted a question here about it.
However, deploy is failing on Vercel's side with a message complaining that that same custom module I'm using couldn't be found. Everything works fine locally.
...ANSWER
Answered 2021-Dec-31 at 07:59There @react-headroom dependency in your package.json points to a github link rather than a dependency version. That seems to be the issue.
QUESTION
I am trying to upgrade tailwind to version 3 in my Laravel application.
I followed the installation as instructed in
https://tailwindcss.com/docs/upgrade-guide#upgrade-packages
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
This worked fine. But when I run npm run dev
I get this error:
ERROR in ./resources/assets/css/tailwindcore.css Module build failed (from ./node_modules/css-loader/index.js): ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js): Error: PostCSS plugin tailwindcss requires PostCSS 8.
I have read from the docs that PostCSS 8 is now required with tailwind 3. However, PostCSS 8 has been installed. Why would I still receive this error? I also tried to remove node_modules folder and reinstall, but got same error.
This is my package.json:
...ANSWER
Answered 2021-Dec-10 at 09:46The issue is that you're running an old version of Laravel Mix. Another issue you will face is the @tailwindcss/form
plugin will need to be updated as well.
Update the packages with:
QUESTION
I have the following postcss.config.js
ANSWER
Answered 2021-Sep-03 at 15:07import
is a keyword not a function so it has a different syntax. See: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Statements/import
So, for example
QUESTION
my class from variable is not working, im sure its mix problem.
...ANSWER
Answered 2021-Nov-30 at 21:01Check your tailwind.config.js
file and look for something like this:
QUESTION
In a new WordPress project I'm using Tailwind CSS with ACF flexible (block) content.
Now I've created a "spacer" block, that can be used in between other blocks.
The thing is, Tailwind JIT is not purging the PHP file correctly. I works good if I echo out the full sting like "h-20" or "sm:h-40", but when I'm creating the string with some PHP filters, it won't work.
For example:
...ANSWER
Answered 2021-Sep-15 at 14:34I'm afraid purgeCSS does not run your code and cannot 'see' these classes. So it's not adding them to the CSS file.
As per the Tailwind documentation on 'Writing purgeable HTML' here
That means that it is important to avoid dynamically creating class strings in your templates with string concatenation, otherwise PurgeCSS won’t know to preserve those classes.
QUESTION
I have been trying to run a project in debug mode for quite a long time and I get an import error, I have already studied a lot of information on this issue and decided to move along the path of setting up babel. The fact is that this project is working and everything started fine, but now I upgraded the version of node 10> 12, next 8> 9, went through all typescript errors, was able to build the build and tried to run it locally, but got an import error
Project: next v9, node v12
// package.json (shortcut):
...ANSWER
Answered 2021-Jul-26 at 06:03Adding "type": "module" to package.json will tell Node you are using ES2015 modules, which should get rid of the error, but then you will need to tell Typescript to generate this type of module by setting "module": "es2015" instead of "commonjs" in tsconfig.json.
answered in: https://stackoverflow.com/a/60225870/16471349
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install purgecss
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page