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

Add support for bower-install #2

Closed
addyosmani opened this issue Feb 2, 2014 · 13 comments
Closed

Add support for bower-install #2

addyosmani opened this issue Feb 2, 2014 · 13 comments

Comments

@addyosmani
Copy link
Member

Is there a plugin equivalent for grunt-bower-install for gulp? If not, should we strip any tags related to this?

cc @stephenplusplus

@stephenplusplus
Copy link

There isn't. I could make it a priority this coming week to make the conversion over, but if anyone else had more knowledge on the subject of grunt-to-gulp, or simply, using gulp to wrap an existing module, I'd greatly welcome their contribution.

@addyosmani
Copy link
Member Author

@sindresorhus probably has the best Gulp knowledge on the team. I would check out https://github.com/gulpjs/gulp/blob/master/docs/writing-a-plugin/README.md if you need some help getting started. In terms of priority, I would say this isn't huge but would be a nice-to-have for sometime this month, even if it's later :)

@sindresorhus
Copy link
Member

No need for a gulp plugin, we can just use wiredep directly. Gulp isn't grunt.

@luisrudge
Copy link

@sindresorhus how can i achieve the same result as grunt-bower-install with wiredep?

@sindresorhus
Copy link
Member

@luisrudge you read the wiredep docs

@luisrudge
Copy link

yes. but grunt-bower-install is way cleaner than wiredep.
https://github.com/stephenplusplus/grunt-bower-install#getting-started
https://github.com/stephenplusplus/wiredep#getting-started

Maybe i didn't understand wiredep completely?

@stephenplusplus
Copy link

I don't know where to put this, but it should just be:

var wiredep = require('wiredep');

// When this is executed, it will run the transformation
// (inject the dependencies into your html)
wiredep({
  directory: 'app/bower_components',
  bowerJson: require('bower.json'),
  src: 'app/index.html',
  ignorePath: 'app/'
});

@luisrudge
Copy link

@stephenplusplus great, thanks!

@passy
Copy link
Member

passy commented Feb 7, 2014

Wouldn't a gulp-y wrapper still be advantageous? I'd like being able to say something like this:

gulp.task('bower', function () {
  return gulp.src('app/*.html').
    .pipe($.wiredep())
    .pipe(gulp.dest('dist/'));
});

@sindresorhus
Copy link
Member

@passy sure, but that doesn't work with how wiredep currently works. wiredep must then accept an array of src strings instead of src paths. gulp works on in-memory files.

@addyosmani
Copy link
Member Author

I'm happy with Sindre's recommendation of just using wiredep directly.

@jgrowl
Copy link

jgrowl commented Feb 11, 2014

@stephenplusplus Thanks for that snippet.
I also had to add this to my index.html

<!-- bower:js -->
<!-- endbower -->

@sindresorhus
Copy link
Member

fixed in 2b8a837

SBoudrias pushed a commit that referenced this issue Feb 15, 2016
Will be back with full Traceur support sometime in the future
eugenious added a commit to eugenious/generator-webapp that referenced this issue Feb 22, 2016
- update the context lines of the changes because they were out of date
- swap the order of changes yeoman#2 and yeoman#3 since they were swapped in the gulpfile
- remove instructions for generating sourcemaps, because sourcemaps are now already included by default
- some other small changes such as from main.less to *.less
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

6 participants