GithubHelp home page GithubHelp logo

Comments (7)

wethecode avatar wethecode commented on June 11, 2024 7

I use a workaround in the Gulp task instead of downgrading Sprockets or skipping the asset pipeline completely. The processed CSS files are being renamed with the notorius .self suffix after gulp.dest but before passed to BrowserSync. So they can be injected when config.assets.debug = true. Of course digests must be off.

Example:

var rename = require('gulp-rename');

gulp.task('sass', function () {
    return gulp.src(config.src)
        .pipe(sourcemaps.init())
        .pipe(sass(config.settings))
                .on('error', handleErrors)
        .pipe(autoprefixer({ browsers: ['last 2 version'] }))
        .pipe(sourcemaps.write())
        .pipe(gulp.dest(config.dest))
        .pipe(rename({
            suffix: '.self'
        }))
        .pipe(browserSync.stream());
});

from gulp-rails-pipeline.

nimzco avatar nimzco commented on June 11, 2024 2

I disabled .self in sprockets 3 and it worked:
config.assets.debug = false in development.rb

See:
http://stackoverflow.com/questions/29732377/how-to-disable-adding-self-in-sprockets-3-0

from gulp-rails-pipeline.

greypants avatar greypants commented on June 11, 2024

Weird! That's super annoying! Thanks for detailing this. Short term solution would be to only include gem assets in your application.js/css files, and pull in your gulp generated files separately with gulp_asset_path. I need to double check that this will work right in production.

for example:

<%= stylesheet_link_tag 'application.css' %>
<link rel="stylesheet" href="<% gulp_asset_path('stylesheets/global.css')%>">

from gulp-rails-pipeline.

DimitryDushkin avatar DimitryDushkin commented on June 11, 2024

I've faced same problem and the best solution I've found is to downgrade to sprockets 2.12.3.(

from gulp-rails-pipeline.

joeswann avatar joeswann commented on June 11, 2024

I'm currently doing something like this:

<%= stylesheet_link_tag 'frontend', media: 'all' %>
<link rel="stylesheet" href="<%= gulp_stylesheet_path 'init.css' %>" media="all"  />

from gulp-rails-pipeline.

benbonnet avatar benbonnet commented on June 11, 2024

Seems very fragile

here is a snapshot (https://40.media.tumblr.com/3778bd65154560b6840eec61e2a2ab70/tumblr_npcek1oAy31qzp3szo1_1280.png) of the difference betweens what's installed on the gem side as of today (my version on the right, causing the problem, the one from this repo on the left)

It does not break browser sync completely, just the css reload when scss or sass files are modified (you have to reload the page manually to see css changes)

from gulp-rails-pipeline.

mfbx9da4 avatar mfbx9da4 commented on June 11, 2024

I made a PR to keep sprockets downgraded also had this problem #28

from gulp-rails-pipeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.