-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build:css NOT working #130
Comments
Following is my ` const $ = gulpLoadPlugins(); gulp.task('styles', () => { function lint(files, options) { gulp.task('lint', lint('app/scripts//*.js')); gulp.task('views', function () { gulp.task('html', ['views', 'styles'], () => { return gulp.src(['app/.html', '.tmp/.html']) gulp.task('images', () => { gulp.task('fonts', () => { gulp.task('extras', () => { gulp.task('clean', del.bind(null, ['.tmp', 'dist'])); gulp.task('serve', ['views', 'styles', 'fonts'], () => { gulp.watch([ gulp.watch('app//*.html', ['views']); gulp.task('serve:dist', () => { gulp.task('serve:test', () => { gulp.watch('test/spec//*.js').on('change', reload); // inject bower components gulp.src('app/partials/.html') gulp.task('build', ['html', 'images', 'fonts', 'extras'], () => { gulp.task('default', ['clean'], () => { |
My guess is the link tags in the head each need to be on a new line. |
Each link is on seperate line in my source code. It is just some formatting issue here. Further, If i paste my script tags from |
I've updated the original post with contents of my |
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. |
I am also having an issue with this. Using the Node REPL, I was able to manually change my line endings and ensure that the link tags where on new lines. I successfully achieved this once, but cannot achieve it again. I am rendering Jade <!-- build:css vendor.css -->
//- bower:css
link(rel='stylesheet', href='../bower_components/animate.css/animate.css')
link(rel='stylesheet', href='../bower_components/jquery-colorbox/example3/colorbox.css')
//- endbower
<!-- endbuild -->
<!-- build:css styles.css -->
//- inject:css
link(rel="stylesheet", href="/styles.css")
//- endinject
<!-- endbuild --> Rendered HTML (./tmp) <!-- build:css vendor.css -->
<link rel="stylesheet" href="../bower_components/animate.css/animate.css"/>
<link rel="stylesheet" href="../bower_components/jquery-colorbox/example3/colorbox.css"/><!-- endbuild -->
<!-- build:css styles.css -->
<link rel="stylesheet" href="/styles.css"/><!-- endbuild --> Notice that Jade doesn't line break the comments here. Any thoughts on this? My thought is to create a pull request to support jade comments so I don't have to compile to read the dependencies. Final HTML (./dist) <link rel="stylesheet" href="vendor.css"> Notice that there is an empty line where the |
+1 the link tag was being separated onto two lines by my editor. bad
good
|
i am having the same issue. i created an issue #165 can someone figure out why i am having this issue as well? i cant seem to find a solution |
Changing LF to CRLF line nedings fixed my problem. Fixing this would be nice. Atom-beautify changes my endings to LF. |
Changing LF to CRLF also helped me on windows. |
remove |
Same, yet the opposite, I'm also using partials, but it concatenates the CSS files from the header.html file and ignores the JS files from the footer.html :/ |
Same here, setting CRLF to true fixed the issue of an empty CSS file after minification, when Js file was working as expected. |
That's really annoying and hard to see. It' will be considered as a bug. |
It's strange that nobody has addressed this issue. This is clearly a bug in Here's my workaround as long as the bug in this package isn't fixed:
Where |
The workaround provided by @markushausammann was extremely helpful to me. Thank you! 👏 I built a website using a template (https://landkit.goodthemes.co) where the template's authors apparently used an unfortunate combination of gulp plugins. It took me quite a while to figure out that LF line ending files were the cause of the issue. I debugged around https://github.com/jonkemp/useref/blob/master/lib/transformReferences.js#L11 and my best guess is that a pipeline step before gulp-useref was producing mixed-line-ending output (suspect: https://github.com/haoxins/gulp-file-include). That is tripping up the relatively simple line ending logic in transformReferences.js. As a result of that, even
will work, if you prefer that. It just needs to be a consistent line ending. |
I'm using following code in my source HTML file:
<!-- build:css styles/vendor.css -->
<!-- endbuild -->
But after compiling it is not concatenating, it creates
vendor.css
file but links to css files remains same instead of pointing tovendor.css
, what could be the issue.On the other hand
build:js
working just as expected. I'm using Gulp Web App Generator with1.3.0
version of useref.UPDATE: My
header.html
which contains this links to css files is not located in rootapp
folder but it is inapp/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 sameapp/partials/
folder. But now in this file it's working just fine. What could be the problem withheader.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
andapp/partials/footer.html
,<link>
and<script>
tags work infooter.html
but not inheader.html
.header.html
`
<!doctype html>
`
footer.html
<!-- build:js scripts/plugins.js -->
<!-- endbuild -->
The text was updated successfully, but these errors were encountered: