Skip to content

Wiredep still includes excluded packages from config #259

@mtpultz

Description

@mtpultz

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!'));
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions