Skip to content
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

Stylesheets are not updated when served through DocPad #1059

Open
c0d0g3n opened this issue Dec 29, 2016 · 0 comments
Open

Stylesheets are not updated when served through DocPad #1059

c0d0g3n opened this issue Dec 29, 2016 · 0 comments

Comments

@c0d0g3n
Copy link

c0d0g3n commented Dec 29, 2016

I have this weird issue where build files are being generated correctly (I see the desired result in my code editor and via the file:// path in my browser), yet when served through DocPad, select changes are not applied.

Below is the build workflow:

  • A less file is changed, DocPad picks this event up and transpiles into css (using docpad-plugin-less), nothing special here

  • docpad-plugin-gulp is configured to execute the gulp cssmin task on writeAfter, this works

  • Below is the cssmin task and the tasks it depends on

      # csspre(fix) task
      gulp.task 'csspre', ->
      	gulp
      		.src 'out/assets/css/screen.css'
      		.pipe autoprefixer
      			browsers: ['last 2 versions', 'firefox >= 18'],
      			cascade: false
      		.pipe gulp.dest 'out/assets/css'
      
      
      # cssconcat task
      gulp.task 'cssconcat', ['csspre'], ->
      	gulp
      		.src 'out/assets/css/*.css'
      		.pipe concat 'screen.css'
      		.pipe gulp.dest 'out/dist/css'
      
      
      # cssmin task
      gulp.task 'cssmin', ['cssconcat'], ->
      	gulp
      		.src 'out/dist/css/screen.css'
      		.pipe cssmin()
      		.pipe rename
      			suffix: '.min'
      		.pipe gulp.dest 'out/dist/css'
    

The resulting minified file is as desired (the placeholders in the form are blue).

However, in development mode I want to link assets/css/screen.css directly (again, this setup does work). I can see in my code editor that the prefixes are applied after each generate, but if I view the files through the console on a DocPad served page, the prefixes are not present. (Neither are the on-screen results.)

My bet is DocPad stores the files somewhere in memory and they're updated after each generate but before my gulp tasks are completed.

I doubt this is caused by autoprefixer itself, because the files are updated correctly outside the DocPad environment. It is neither caused by livereload, as the issue persists while this plugin is disabled.

As the code of this project is available on GitHub, you may try to reproduce the issue there. I don't exclude some stupidity of mine, but that would be an embarrassment :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants