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

Not working with pug? #243

Open
pwnjack opened this issue May 27, 2016 · 8 comments
Open

Not working with pug? #243

pwnjack opened this issue May 27, 2016 · 8 comments

Comments

@pwnjack
Copy link

pwnjack commented May 27, 2016

Wiredep seems to not work with .pug (formerly .jade). I get no errors but isn't injecting at all. Am I doing something wrong?

This is my gulp task:

gulp.task('wiredep', function () {
  gulp.src('app/views/partials/master.pug')
    .pipe(wiredep({ignorePath: '../../'}))
    .pipe(gulp.dest('app/views/partials/'));
});

And these are the tags in my .pug file:

//- bower:css
//- endbower

//- bower:js
//- endbower

These are the dependencies that should be injected, from my bower.json file.

"dependencies": {
    "bootstrap": "^3.3.6",
    "font-awesome": "^4.6.3",
    "holderjs": "^2.9.3"
  },
@eddiemonge
Copy link
Contributor

thats because pug support hasnt been added in yet #239

@pwnjack
Copy link
Author

pwnjack commented Jun 8, 2016

I noticed the merge and I downloaded wiredep again via npm, the injection still not working with pug files, tho. Any clue?

Edit: the package on npm registry seems not updated yet, that's why.

@eddiemonge
Copy link
Contributor

Yeah I didn't do a release yet since its needs a bit of testing. If you want to npm install the git version and try it out that would be helpful.

@carusog
Copy link

carusog commented Nov 18, 2016

@pwnjack
You can use HTML comments as usual waiting for a full integration since all lines beginning with < are treated as plain text by Pug, so

<!--bower:css-->
<!--endbower-->

will work just fine.

@pwnjack
Copy link
Author

pwnjack commented Nov 18, 2016

@carusog
Nice workaround.
For the records, i tried out the new version via git install and after a bit of testing it seems to work fine! ;)

@zhekaus
Copy link

zhekaus commented Feb 1, 2017

I've spend two hours to figure out what is wrong with wiredep (((

@Tenemo
Copy link

Tenemo commented Mar 21, 2017

@carusog

You can use HTML comments as usual waiting for a full integration since all lines beginning with < are treated as plain text by Pug, so

<!--bower:css-->
<!--endbower-->

will work just fine.

Thanks, that works perfectly! To anyone who's stuck at this as long as I was - carusog's fix still works and is required, because wiredep, as of 4.0.0, doesn't support .pug. The only downside is that now the html comment will actually appear in the output, unlike pug comment lines, but I can live with that.

@pwnjack
Copy link
Author

pwnjack commented Mar 21, 2017

@Tenemo

You can install the latest wiredep version (working with pug) via npm with this command:

npm install git+https://github.com/taptapship/wiredep.git

This is the git repo version and will work just fine.

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

5 participants