Code Monkey home page Code Monkey logo

gulp-bower-src's People

Contributors

bclozel avatar lukaszb avatar riy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

lukaszb kingles riy

gulp-bower-src's Issues

Ignoring a directory results in empty directory

My gulpfile.js has the following:

[…]
gulp.task("includeVendor", function () {
  // Copy vendor scripts to working directory
  return bowerSrc()
    .pipe(changed("js/vendor"))
    .pipe(filters.alreadyMinified)
    .pipe(uglify())
    .pipe(filters.alreadyMinified.restore())
    .pipe(gulp.dest("js/vendor"))
    .pipe(notify({ message: "Vendor scripts copied."}));
});
[…]

Here are my overrides (in the bower.json file at the root of my project):

{
  […]
  "overrides": {
    "jquery": {
      "ignore": [
        "*.json",
        "*.txt",
        "src/**",
        "dist/*.min.*"
      ]
    }
  }
}

Notice the "src/**", which results in an empty directory called src on my destination folder, like so: js/jquery/src/[nothing-here]. I tried ignoring the folder with "src" and "src/", but both of those resulted in the entire contents of that folder being copied over inside the destination’s src directory.

Arguments to path.resolve must be strings

I have this

gulp.task('package', function () {
bowerSrc()
.pipe(gulp.dest('./dist'));
});

but when I run "gulp package" I get

package' errored after 231 μs
[13:57:16] TypeError: Arguments to path.resolve must be strings
at Object.exports.resolve (path.js:313:15)
at gulpBowerSrc (/Users/scott/Dropbox/sandbox/modernapp/node_modules/gulp-bower-src/index.js:89:31)
at Gulp. (/Users/scott/Dropbox/sandbox/modernapp/gulpfile.js:71:5)
at module.exports (/Users/scott/Dropbox/sandbox/modernapp/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/scott/Dropbox/sandbox/modernapp/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/scott/Dropbox/sandbox/modernapp/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/scott/Dropbox/sandbox/modernapp/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20
at process._tickCallback (node.js:442:13)
at Function.Module.runMain (module.js:499:11)

Copy only "main" from .bowser.json

For example, jQuery’s .bower.json (and bower.json, for that matter) have a "main" json key:

{
  "name": "jquery",
  "version": "1.11.0",
  "main": "dist/jquery.js",
  "license": "MIT",
  […]
}

Now I could just throw that path in the pipe, but would love to do it via a plugin. I’m not well-versed in bower components; is "main" required in a component’s bower.json file? If so, it’d be great to get the option to just choose that one asset and put it in the pipe, as opposed to going the ignore route.

Use "main" instead of "ignore"

Seems like it would make more sense to src files using "main" instead of "ignore" since these are the primary files that are needed for the package, and the files you would want to copy over to a dist dir.

"ignore" is just to tell your bower package that certain files don't need to be downloaded when installing (via the command line typically).

This assumes I understand this package correctly.

Edit: the files listed in ignore shouldn't even exist in your bower_components directory in the first place, per the bower spec: https://github.com/bower/bower.json-spec

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.