frodefi / bower-main Goto Github PK
View Code? Open in Web Editor NEWGet bower main files in both normal and minimized formats (if available in package)
Get bower main files in both normal and minimized formats (if available in package)
My bower files other folder when i run my gulp tusk this exception return bower.json file does not exist
This errors return when bower( 'css', 'min.css' ) this function run
Why?
For a few days, I've been trying to remove duplicate files from my merge and I found the gulp-dedupe very easy to implement and really useful.
I strongly recommend to use before concat()
return merge2(
gulp.src('static/src/tpl/*.html')
.pipe(minifyHtml({empty: true}))
.pipe(ngtemplate({
module: 'genTemplates',
standalone: true
})
), gulp.src([
'static/src/js/app.js',
'static/src/js/locale_zh-cn.js',
'static/src/js/tools.js',
'static/src/js/services.js',
'static/src/js/locale_zh-cn.js', //example duplicated file
'static/src/js/controllers.js'
])
)
.pipe(dedupe())
.pipe(concat('app.js'))
.pipe(gulp.dest('static/dist/js/'));
});
Hey frodefi,
I've been using this plugin for some time and it's been working on my linux laptop perfectly. Lately though I've got some new colleagues who work on windows and there it doesn't seem to do anything. It doesn't crash or report anything, but it also doesn't generate the expected files.
Is this an issue you have encountered already?
This is the bower-main part of my gulpfile.js
var bowerMain = require('bower-main');
var bowerMainJavaScriptFiles = bowerMain('js', 'min.js')
var bowerMainCssFiles= bowerMain('css', 'min.css')
gulp.task('bower', function() {
return gulp.src(bowerMainJavaScriptFiles.normal)
.pipe(concat('vendor-scripts.js'))
.pipe(gulp.dest('web/bundles/global/vendor'));
});
gulp.task('bowerprod', function(){
return merge2(
gulp.src(bowerMainJavaScriptFiles.minified),
gulp.src(bowerMainJavaScriptFiles.minifiedNotFound)
.pipe(concat('tmp.min.js'))
.pipe(uglify())
)
.pipe(concat('vendor-scripts.js'))
.pipe(gulp.dest('web/bundles/global/vendor'));
});
gulp.task('bowercss', function() {
return gulp.src(bowerMainCssFiles.normal)
.pipe(concat('vendor-styles.css'))
.pipe(gulp.dest('web/bundles/global/vendor'));
});
gulp.task('bowercssprod', function(){
return merge2(
gulp.src(bowerMainCssFiles.minified),
gulp.src(bowerMainCssFiles.minifiedNotFound)
.pipe(concat('tmp.min.css'))
.pipe(uglify())
)
.pipe(concat('vendor-styles.css'))
.pipe(gulp.dest('web/bundles/global/vendor'));
});
This is not useful anymore and I recommend to use main-bower-files
directly or even better switch to yarn/npm. Can you add the deprecated note?
For some reason not all the expected css files are found. In my current setup, bower-main misses the css files for bootstrap and only returns the ones from Datatables. I believe it might be due to the underlying bower-main-files but I can't tell with certainity.
These are my bower.json and gulpfile.js
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"bootstrap": ">=3.1.1",
"jquery": ">=2.1.0",
"DataTables": ">=1.10.7",
"bootbox": ">=4.4.0"
}
}
var bowerMainCssFiles = bowerMain('css', 'min.css');
gulp.task('bowercss', function() {
return gulp.src(bowerMainCssFiles.normal)
.pipe(concat('vendor-styles.css'))
.pipe(gulp.dest('web/bundles/global/vendor'));
});
There should be a way to pass though parameters to mainBowerFiles. Alternatively, let the user call mainBowerFiles directly and pass its results to bowerMain.
I am trying to use this package with Sammy framework, but it doesn't bring the main file of this package. Here is my Gulp task:
var gulp = require('gulp'),
bower = require('bower-main'),
concat = require('gulp-concat');
gulp.task('script', function() {
return gulp.src(bower('js').normal)
.pipe(concat('main.js'))
.pipe(gulp.dest('app'));
});
It is a problem with Sammy package?
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.