I am using gulp usemin task to combine and minimize/uglify the css and js files in my HTML.
gulp.task('usemin',['jshint'], function () {
return gulp.src('./app/**/*.html')
.pipe(usemin({
css:[minifycss(),rev()],
js: [uglify(),rev()]
}))
.pipe(gulp.dest('dist/'));
});
And my blocks in HTML:
<!-- build:css styles/main.css -->
<link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="../bower_components/bootstrap/dist/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="styles/home.css" rel="stylesheet">
<link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<!-- endbuild -->
<!-- build:js scripts/main.js -->
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="../bower_components/angular/angular.min.js"></script>
<script src="../bower_components/jquery-ui/jquery-ui.min.js"></script>
<script src="scripts/home.js"></script>
<script src="scripts/controllers.js"></script>
<!-- endbuild -->
But after I have done this. in the dist/, all other parts work well as they are in app/ but jquery-ui.js. The color animation in my page doesn't work, which is due to jquery-ui.
file structure: file structure
How could this be? Only one js file doesn't work, but others works fine?
I find it out by myself. I need to add the jquery-ui css file for color animation into HTML like this:
But I am still not so sure why I can use jquery-ui without any problems before I minimize the CSS files.