Comments (6)
I'll take a look into this. It should be something we can show in the demo at least.
from grunt-uncss.
Run into this also, with default yeoman angularjs
setup the cssmin uses:
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
and then uncss
complains:
Running "uncss:dist" (uncss) task
Error: could not find: app/styles/main.css
althought it should be searching the .tmp
directory instead.
from grunt-uncss.
+1
from grunt-uncss.
@vertti or if anybody have still trouble with this, you can use this setup in your Gruntfile.js to make uncss play nice with yeoman without even changing the index.html
// Remove unused css
uncss: {
dist: {
files: [{
src: ['<%= yeoman.app %>/*.html', '<%= yeoman.app %>/views/{,*/}*.html'],
dest: '.tmp/concat/styles/main.css'
}]
},
options: {
csspath: '../.tmp/concat/'
}
}
and then in the build task run uncss just before thee cssmin task:
grunt.registerTask('build', [
'clean:dist',
'bower-install',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngmin',
'copy:dist',
'cdnify',
'uncss', // here you are
'cssmin',
'uglify',
'rev',
'usemin',
'htmlmin'
]);
you can leave the index.html as it is:
<!-- build:css({.tmp,app}) styles/main.css -->
from grunt-uncss.
The problem I have with that approach is that usemin
does slightly the same thing as uncss
. It parses my index.html
and generates a new CSS file. So running usemin
after uncss
overwrites the file uncss
created.
rev
makes this complicated too, as you can't run uncss
after it (because of unknown rev'ed filenames) but you need to run usemin
after rev
. And running uncss
after usemin
results in a non-minified CSS.
from grunt-uncss.
@kuus +1 thanks!
from grunt-uncss.
Related Issues (20)
- Incomplete css HOT 1
- Sync Multiple Vscode?
- Missing dependency of PhantomJS HOT 1
- Regex in src urls HOT 3
- JS errors without inline scripts HOT 1
- Fatal error: Cannot communicate with PhantomJS process: PhantomJS exited unexpectedly: read ECONNRESET HOT 2
- Not taking into account the classes that are added through angular HOT 5
- does it conflict with JQuery HOT 2
- bootstrap alert not processed HOT 1
- Grunt uncss fails silently mac HOT 2
- "ignoreSheets : [/fonts.googleapis/]" isn't ignoring Google fonts HOT 1
- Fatal error: connect ECONNREFUSED 127.0.1.1:80 HOT 2
- Fatal error: uncss/node_modules/css: unable to parse... Excessive slag in URI. HOT 2
- UnhandledPromiseRejectionWarning: Unhandled promise rejection HOT 2
- file.src should be file.orig.src (grunt 1.0.1)
- ignore doesn't work HOT 2
- GitHub Actions CI HOT 3
- Timing Problems with many files HOT 1
- Remove deprecated request package
- Does this work project-wide with SASS files?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-uncss.