sheerun / bower-away

A tool for migrating away from Bower (to Yarn)
306 stars 20 forks source link

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

Open ragesoss opened 6 years ago

ragesoss commented 6 years ago

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?

sheerun commented 6 years ago

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

sheerun commented 6 years ago

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