Skip to content

targetPath issue #16

Closed
Closed

Description

@zawilliams

I think I've got the path, targetPath and fontPath configured correctly, but I'm having an issue now with targetPath.

I'm working on a Laravel app and have my gulpfile located in the project root. So my directory structure looks like:

  • /app
  • /public
  • gulpfile.js

My gulp configuration code for this plugin is as follows:

var fontName = 'icons';

gulp.task('icon-font', function(){
    gulp.src(['app/assets/icons/*.svg'])
        .pipe(iconfontcss({
            fontName: fontName,
            path: 'app/assets/scss/templates/_icons.scss',
            targetPath: '../../../app/assets/scss/components/_icons.scss',
            fontPath: '../fonts/'
        }))
        .pipe(iconfont({
            fontName: fontName
        }))
        .pipe(gulp.dest('public/assets/fonts/'));
});

The problem I'm running into is this: the targetPath is supposed to go into app/assets/scss/components/ but its going into public/assets/scss/components instead. It's like "app" is being replaced by "public" in the path.

Am I doing something wrong or is this an issue with the plugin?

Activity

  1. zawilliams commented on Apr 4, 2014

    @zawilliams
    Author

    I've figured out how to solve the issue: by adding a base to the src.

    Here's the src line that I used:

    gulp.src(['app/assets/icons/*.svg'], {base: 'app/assets'})

  2. backflip commented on Apr 5, 2014

    @backflip
    Owner

    Which version of Gulp are you using?

  3. zawilliams commented on Apr 6, 2014

    @zawilliams
    Author

    Using 3.5.6

  4. added a commit that references this issue on Apr 7, 2014
  5. backflip commented on Apr 7, 2014

    @backflip
    Owner

    Hm, weird. I have added a note to the README. Thanks for reporting!
    Anyway, this plugin is most likely going to be deprecated and the recommended solution won't have this issue: #9

  6. Iuriy-Budnikov commented on Aug 17, 2015

    @Iuriy-Budnikov

    Option base not works for me.
    gulp 3.9.0

    Issue still is open.

  7. backflip commented on Aug 17, 2015

    @backflip
    Owner

    Hey Iuriy,
    could you save your Gulpfile to https://gist.github.com so I can try to reproduce it?

  8. benifbond commented on Jun 18, 2023

    @benifbond

    How can I resolve this problem ?
    The targetPath creates a subfolder inside the fonts folder that comprises the full working path inside the fonts director.
    For example:
    fonts/
    Users/username/full project path/icons.scss.

    The problem occurs in MacOs and Linux. I do not desire to have either additional folders created or _icons.scss.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions