laravel-mix-purgecss | Zero-config Purgecss for Laravel Mix | Internationalization library
kandi X-RAY | laravel-mix-purgecss Summary
kandi X-RAY | laravel-mix-purgecss Summary
Zero-config Purgecss for Laravel Mix
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 laravel-mix-purgecss
laravel-mix-purgecss Key Features
laravel-mix-purgecss Examples and Code Snippets
npm i laravel-mix-purgecss
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.purgeCss({ enabled: true });
let mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
// Removes unused CSS
// According to Discord chat: Running Purge CSS as part of Post CSS is a ton faster than laravel-mix-purgecss
// But if that doesn't work
Community Discussions
Trending Discussions on laravel-mix-purgecss
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
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'm using Laravel Mix and PostCSS to build Tailwind.
Everything works, I can even Purge unused styles.
I have strange outputs when I build (a LOT of these) :
...ANSWER
Answered 2021-Jan-15 at 18:41I'm not sure if that helps, but I will show you my config that seems to be working fine (using Sass), I removed some irrelevant parts.
webpack.mix.js
QUESTION
I'm using @loadable/component
in the following way:
app.js
...ANSWER
Answered 2020-Dec-18 at 12:12The reason you are getting this error is because one of your dependencies (or maybe even your code) relies on React.createContext
method.
This is part of the "context API" introduced in version 16.3 (changelog)
You either have to remove the dependency that requires this later react version, or upgrade your react version to at least 16.3.
Typically, when a dependency in your package.json depends on a specific version of react, it would list that version as a "peer dependency". If so, when running npm install
you would receive a warning that looks like
QUESTION
I want to install the latest version of buefy in my project, which is 0.9.3. Currently I have installed 0.8.3
If I run npm install -g buefy@latest
I receive
npm WARN buefy@0.9.3 requires a peer of vue@^2.6.11 but none is installed. You must install peer dependencies yourself.
- buefy@0.9.3 updated 1 package in 0.511s
However, Buefey 0.8.2 remains installed in package.json
I also have difficulties to understand the error, because I have vue 2.6.12
installed.
I tried to run (as explained in https://stackoverflow.com/a/58254678/2311074)
...ANSWER
Answered 2020-Oct-12 at 12:27npm install -g
means you're trying to install a package globally.
QUESTION
Im using webpack to run a watch on .js
files being changed, but I need to use wildcards instead of specific file names for my project. I'm currently using the commands below and it works fine and compiles all the expected files when I run npm run watch
, but it will never run again after I make a change directly in any of the files. I have to stop watching and re-run the same command again and again. Is there something I am missing?
ANSWER
Answered 2020-Aug-28 at 20:41Edit your package.json file - change this:
"watch": "npm run development -- --watch",
To this:
"watch": "node_modules/.bin/webpack --watch --watch-poll --config=node_modules/laravel-mix/setup/webpack.config.js",
QUESTION
I’m trying to purge my css file with laravel-mix-purgecss. This is what i've done:
- Installed it with NPM
- Added
.purgeCss()
to mywebpack.mix.js
file - Added
require(’laravel-mix-purgecss’);
to myapp.js
But all I get when running npm run dev
, it fails at:
ANSWER
Answered 2020-Mar-11 at 09:41Remove this line from app.js
and add it to webpack.mix.js
instead:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install laravel-mix-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