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

Doesn't work when path contains a url hash #1766

Open
3 of 10 tasks
pleek91 opened this issue May 26, 2020 · 0 comments
Open
3 of 10 tasks

Doesn't work when path contains a url hash #1766

pleek91 opened this issue May 26, 2020 · 0 comments

Comments

@pleek91
Copy link

pleek91 commented May 26, 2020

Issue details

I'm running into this issue specifically with svg use element files that contain a url has specifying the id of the <symbol> to use.

<svg>
    <use xlink:href="Sprite.svg#MyIcon"></use>
</svg>

I believe I have my browser-sync configured properly because I see in the console and in the browsers ws log that Sprite.svg was changed. But the <use> element on the page is not updated.

Steps to reproduce/test case

I believe this will be reproducible with any path with a url hash in it.

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [ 2.26.7 ]
  • Node [ 12.16.1 ]
  • Npm [ 6.13.4 ]

Affected platforms

I believe this would effect all of them. But I'm on windows

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • CLI

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

gulp.task('browser-sync', function() {
    browserSync.init({
        proxy: 'local-domain.localhost',
    });

    gulp.watch(['./Images/svg/Sprites/**/*.svg', '!./Images/svg/Sprites/*.svg'], gulp.series('svg-build-sprites'));
});

gulp.task('svg-build-sprites', () => {

    return gulp.src(`./Images/svg/Sprites/Icons/*.svg`)
        .pipe( svgmin( {
            plugins: [
                { removeViewBox: false },
                { removeUselessStrokeAndFill: true },
                { removeEmptyAttrs: false },
                { removeUnknownsAndDefaults: false },
                { cleanupIDs: false },
                { removeUselessStrokeAndFill: true }
            ]
        } ) )
        .pipe( rename( { prefix: 'icon-' } ) )
        .pipe( svgstore( { inlineSvg: true } ) )
        .pipe( rename( 'Sprite.svg' ) )
        .pipe( gulp.dest( './Images/svg/Sprites/' ) )
        .pipe(browserSync.stream());

});

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

No branches or pull requests

1 participant