gulp-useref: build:css NOT working
I’m using following code in my source HTML file:
<!-- build:css styles/vendor.css -->
<link rel="stylesheet" href="styles/lib/stylesheet-1.css">
<link rel="stylesheet" href="styles/lib/stylesheet-2.css">
<link rel="stylesheet" href="styles/lib/stylesheet-3.css">
<!-- endbuild -->
But after compiling it is not concatenating, it creates vendor.css file but links to css files remains same instead of pointing to vendor.css, what could be the issue.
On the other hand build:js working just as expected. I’m using Gulp Web App Generator with 1.3.0 version of useref.
UPDATE: My header.html which contains this links to css files is not located in root app folder but it is in app/partials/ folder.
UPDATE#2: On second try it doesn’t seems to be subfolder issue either. I tried embedding these links in footer.html file which is located in same app/partials/ folder. But now in this file it’s working just fine. What could be the problem with header.html file? I tried stripping this file code to minimum to isolate any issue but in vain.
UPDATE#3: Here are contents of my app/partials/header.html and app/partials/footer.html, <link> and <script> tags work in footer.html but not in header.html.
header.html
` <!doctype html>
<html class="no-js"><head>
<title>pageTitle</title>
<!-- build:css styles/vendor.css -->
<link rel="stylesheet" href="styles/lib/royalslider.css">
<link rel="stylesheet" href="styles/lib/rs-default.css">
<link rel="stylesheet" href="styles/lib/rs-minimal-white.css">
<link rel="stylesheet" href="styles/lib/font-awesome.min.css">
<link rel="stylesheet" href="/bower_components/slidebars/dist/slidebars.css">
<link rel="stylesheet" href="/bower_components/magnific-popup/dist/magnific-popup.css">
<!-- endbuild -->
<!-- build:css styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
<!-- build:js scripts/vendor/modernizr.js -->
<script src="/bower_components/modernizr/modernizr.js"></script>
<!-- endbuild -->
</head>
<body>
`
footer.html
<!-- build:js scripts/plugins.js -->
<script src="/bower_components/jquery/dist/jquery.js"></script>
<script src="/bower_components/foundation/js/foundation.js"></script>
<script src="/bower_components/superfish/dist/js/superfish.js"></script>
<script src="/bower_components/masonry/dist/masonry.pkgd.js"></script>
<script src="/bower_components/magnific-popup/dist/jquery.magnific-popup.js"></script>
<script src="/bower_components/backgroundCheck/background-check.js"></script>
<script src="/bower_components/imagesloaded/imagesloaded.pkgd.js"></script>
<script src="/bower_components/jquery-validate/dist/jquery.validate.js"></script>
<script src="/bower_components/slidebars/dist/slidebars.js"></script>
<script src="scripts/lib/royalslider.min.js"></script>
<script src="scripts/lib/smoothscroll.js"></script>
<!-- endbuild -->
<!-- build:js scripts/main.js -->
<script src="scripts/main.js"></script>
<!-- endbuild -->
</body></html>`
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 16 (1 by maintainers)
I was having the exact same issue described as above, and found out it was caused by Unix style line endings on my header.html file. Changing header.html to Windows style (CRLF) line endings fixed the issue.
+1 the link tag was being separated onto two lines by my editor.
bad
good