bower-away icon indicating copy to clipboard operation
bower-away copied to clipboard

migration blocked by gulp and 'main-bower-files`

Open ragesoss opened this issue 8 years ago • 2 comments

I tried using bower-away on my project (https://github.com/WikiEducationFoundation/WikiEduDashboard) but I ran into trouble with dependencies on bower.json. One of the gulp tasks for the build looks like this:

import gulp from 'gulp';
import mainBowerFiles from 'main-bower-files';
import loadPlugins from 'gulp-load-plugins';
const plugins = loadPlugins();
import config from '../config.js';


//--------------------------------------------------------
// Concatenate Bower libraries
//--------------------------------------------------------

gulp.task('bower', () => {
  return gulp.src(mainBowerFiles())
    .pipe(plugins.concat('vendor.js'))
    .pipe(gulp.dest(`${config.outputPath}/${config.jsDirectory}`));
});

This task breaks with bower.json missing, and it doesn't play nicely with the symlinked vendor if I follow the rest of the steps but keep bower.json.

Any pointers on how to work through this?

ragesoss avatar Oct 13 '17 23:10 ragesoss

bower.json is not missing, but .bower.json could be. might it be the issue?

sheerun avatar Oct 14 '17 13:10 sheerun

The solution would be to create post-install command that creates these files, but really ideally you shoud change your gulp script so it doesn't depend on .bower.json but bower.json

sheerun avatar Oct 19 '17 21:10 sheerun