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

Wiredep still includes excluded packages from config #259

Open
mtpultz opened this issue Oct 3, 2016 · 6 comments
Open

Wiredep still includes excluded packages from config #259

mtpultz opened this issue Oct 3, 2016 · 6 comments

Comments

@mtpultz
Copy link

mtpultz commented Oct 3, 2016

Wiredep still includes excluded packages from config and keeps saying that ionic is not installed, but I'd like to exclude this package. I also tried ignoredDependencies #249.

[15:57:59] Plumber found unhandled error:
 Error: Error: ionic is not installed. Try running `bower install` or remove the component from your bower.json file.

In case it was a file path issue I tried a variety of excluded paths.

    wireDep: {
        options: {
            bowerJson: require('../bower.json'),
            directory: 'www/lib', // TODO: figure out why require('../.bowerrc').directory doesn't work
            devDependencies: false,
            ignoredDependencies: [
                'ionic',
                'lib/ionic',
                'www/lib/ionic'
            ],
            exclude: [
                'ionic',
                'lib/ionic',
                'www/lib/ionic'
            ]
        }
    }

Docs also say that by default devDependencies are not included, but the error is related to ionic not being installed even though it is in devDependencies. So I tried also setting this to false.

{
  "name": "App",
  "private": "true",
  "devDependencies": {
    "ionic": "driftyco/ionic-bower#1.3.1"
  },
  "dependencies": {
    "lodash": "^4.16.3",
    "moment": "^2.15.1",
    "moment-round": "^1.0.2",
    "moment-timezone": "^0.5.5",
    "angular-moment": "^0.10.3",
    "angular-messages": "^1.5.8",
    "angular-locker": "^2.0.4",
    "angular-jwt": "^0.1.5",
    "angular-scroll-glue": "^2.0.7",
    "ngmap": "^1.17.6"
  }
}
'use strict';

var path = require('path');
var wireDep = require('wiredep').stream;

var gulp = require('gulp');
var plumber = require('gulp-plumber');

var config = require('./../config.js');
var helpers = require('./../helpers.js');

/**
 * Injects vendors scripts and styles into the HTML index between delimiters,
 * and place the vendors files in order based on their dependencies. This
 * task is executed automatically on postinstall and postuninstall of
 * any bower components, but can also be executed manually.
 * ---
 * NOTE: Vendor injections are in a separate injection task in order to speed
 * up the task in case the build step processes for the application are
 * long winded.
 */
gulp.task('inject-vendors', [], function () {

    helpers.log('Inject Vendors');

    var indexPath = path.join(config.indexPath, config.index);
    var options = config.wireDep.options;

    return gulp.src(indexPath)
               .pipe(plumber())
               .pipe(wireDep(options))
               .pipe(gulp.dest(config.indexPath))
               .pipe(helpers.notify('Vendors Injected!'));
});
@stephenplusplus
Copy link
Member

Try 'wiredep' key, not 'wireDep' :)

@mtpultz
Copy link
Author

mtpultz commented Oct 3, 2016

That's just a reference var wireDep = require('wiredep').stream;, but I'll try it without stream.

@stephenplusplus
Copy link
Member

Ah, okay sorry. Looked like a grunt config at a glance.

@mtpultz
Copy link
Author

mtpultz commented Oct 3, 2016

require('wiredep')(options) still produces the same error. I would have thought temporarily removing the devDependencies and not running bower update would have worked, but still get the same error.

@stephenplusplus
Copy link
Member

Is it possible to put a quick repo together that I can clone && bower install && npm install && npm test?

@tomchomiak
Copy link

Having the same issue

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

3 participants