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 resolve same-directory relative pathnames correctly #23

Open
HughxDev opened this issue Mar 1, 2016 · 0 comments
Open

Doesn't resolve same-directory relative pathnames correctly #23

HughxDev opened this issue Mar 1, 2016 · 0 comments

Comments

@HughxDev
Copy link

HughxDev commented Mar 1, 2016

/webroot/gulpfile.js:

gulp.task( 'inline:templates', function () {
  var inlineSourceOptions = {
    // attribute: 'inline',
    compress: false,
    pretty: true
  };

  return gulp.src( './build/templates/**/*.html', {
    base: './build/foo/'
  } )
    .pipe( $.inlineSource( inlineSourceOptions ) )
    .pipe( gulp.dest( './build/templates/' ) )
  ;
} );

/webroot/build/templates/foo/bar/:

  • index.html
  • style.css

/webroot/build/templates/foo/bar/index.html:

<link href="style.css" inline>

gulp inline:templates:

events.js:154
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open '/webroot/build/templates/style.css'
at Error (native)

In order to get gulp-inline-source to work I instead have to use a leading dot and slash, e.g. <link href="./style.css" inline>. This is unnecesary from a URL perspectvie, and not immediately obvious (I spent a lot of time debugging to figure this out).

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