bclozel / gulp-bower-src Goto Github PK
View Code? Open in Web Editor NEWGulp-src bower components files
License: MIT License
Gulp-src bower components files
License: MIT License
Isn't this the same as gulp-bower-files?
The reason for that was this issue, which is already closed:
Is there any other reasons for that error? I'm facing this error trying to bundle the FullCalendar plugin.
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.
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)
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.