gulp

Gulp Copying Files from one Directory to another

不羁岁月 提交于 2019-12-05 10:27:40
问题 I want to Gulp Copy Multiple Files gulp.task('copy', function(){ gulp.src( 'bower_components/bootstrap/dist/js/bootstrap.js', 'bower_components/jquery/dist/jquery.min.js', 'bower_components/jquery.stellar/src/jquery.stellar.js', 'bower_components/jquery-waypoints/waypoints.js', 'bower_components/jquery-easing-original/jquery.easing.1.3.js') .pipe(gulp.dest('public/assets/js')); }); To copy my files from my bower_components directory to my assets directory, but it is only working with the

使用gulp编译es6 , less 代码

我与影子孤独终老i 提交于 2019-12-05 10:27:19
传统的js代码是不支持箭头函数 和 es6的继承特性的 写个类 , 继承还要写个闭包 , call , prototype。。菜鸟的我 表示挺麻烦的 挺麻烦的 这个只是把幕课网上配置的视频简化成文字 , 下次使用的时候不用再次打开视频 1.新建项目文件 src src目录下新建 css js less gulpfile.js webpack.config.js文件 www目录下新建css js index.html文件 2.初始化项目 npm init , 安装依赖 cnpm install babel-core babel-loader babel-present-es2015 gulp gulp-less gulp-util webpack-stream --save-dev 3.编写gulp编译的配置文件 , const gulp = require("gulp"); const webpack = require('webpack-stream'); gulp.task('webpack' , () => { //转译javascript //webpack 配置 const config = require('./webpack.config.js'); gulp.src('./js/**/*.js') .pipe(webpack(config)) .pipe(gulp

Node (Gulp) process.stdout.write to file

好久不见. 提交于 2019-12-05 09:06:40
I'm trying to have gulp taking care of my unit tests for me, and outputting my test coverage to a .lcov file. This is what I have so far : gulp.task('test', function () { var test = fs.createWriteStream('./test.lcov', {flags: 'a'}); return gulp.src('./assets/js/test/test.js', {read: false}) .pipe(mocha({reporter: 'mocha-lcov-reporter'})) .pipe(test); }); The mocha-lcov-reporter code can be found here : https://github.com/StevenLooman/mocha-lcov-reporter/blob/master/lib/lcov.js It outputs results through process.stdout.write() But when I pipe this to a WriteStream I have the following error :

I want to automatically fix my CSS source files, but I get an endless loop

白昼怎懂夜的黑 提交于 2019-12-05 09:01:37
I use gulp-stylefmt and it run every time I save any CSS file: function stylelint () { return gulp.src('src/**/*.css') .pipe($.stylefmt()) .pipe(gulp.dest('src/')); } Same time gulp.watch watches the path src/**/*.css and run stylelint task again. Console output: [16:32:24] Starting 'stylelint'... [16:32:25] Finished 'stylelint' after 554 ms [16:32:25] Starting 'stylelint'... [16:32:25] Finished 'stylelint' after 60 ms [16:32:25] Starting 'stylelint'... [16:32:25] Finished 'stylelint' after 33 ms [16:32:25] Starting 'stylelint'... [16:32:25] Finished 'stylelint' after 36 ms [16:32:26] Starting

前端文档汇总(含代码规范、开发流程、知识分享,持续更新)

左心房为你撑大大i 提交于 2019-12-05 08:34:30
front-end-Doc 前端文档汇总(含代码规范、开发流程、知识分享,持续更新) 原Github地址 进去后可直接点链接查看文章 综合类 地址 前端文档基本例子 https://github.com/mgbq/front... 前端知识体系 http://www.cnblogs.com/sb1987... 前端知识结构 https://github.com/JacksonTia... Web前端开发大系概览 https://github.com/unruledboy... Web前端开发大系概览-中文版 http://www.cnblogs.com/unrule... Web Front-end Stack v2.2 https://raw.githubusercontent... 免费的编程中文书籍索引 https://github.com/justjavac/... 前端书籍 https://github.com/dypsilon/f... 前端免费书籍大全 https://github.com/vhf/free-p... 前端知识体系 http://www.cnblogs.com/sb1987... 免费的编程中文书籍索引 https://github.com/justjavac/... 智能社 - 精通JavaScript开发 http://study.163.com

Can you use subdirectories within Jekyll's _includes folder?

被刻印的时光 ゝ 提交于 2019-12-05 08:34:20
My plan is to have folders within the _includes directory: _includes/footers _includes/heros _includes/cta etc... When I reference that {% include footers/footer1.html %} I get the following error: Liquid Exception: Included file '_includes/footers/footer1.html' not found in _layouts/default.html Is this outside the intended functionality, or am I missing something? Bryan Schuetz Yes you can nest partials. Subdirectories don't have to be prepended with an underscore. Let's say you have a footers folder inside the _includes folder. _includes/footers You could include your resources by adding

Gulp glob to ignore file types and not copy empty folders

做~自己de王妃 提交于 2019-12-05 08:33:52
I have created a glob for gulp which ignores javascript and coffeescript files within a set of directories. I'd like it to copy all other files into a directory which works fine. The only problem is that when there are only javascript or coffeescript files it copies an empty folder. Any ideas how this glob could be amended to not copy empty folders? gulp.task('copyfiles', function(){ gulp.src('apps/*/static_src/**/!(*.js|*.coffee)') .pipe(gulp.dest('dest')); }); Example source files: apps/appname/static_src/images/image.jpg apps/appname/static_src/js/script.js Expected output: dest/static_src

ES6 unit testing without compilation

馋奶兔 提交于 2019-12-05 08:32:35
I'm not able to find any examples of Mocha or any other unit test framework running directly on ES6 code via Gulp. (No Babel, Webpack, etc.) I've tracked down one example of Mocha (with some modification) running in a browser on ES6 code, but it was not automated. Is anyone testing ES6 code directly yet? (I understand this isn't the 'proper' format of an SO question, but I'm in the 'where do I start' phase here.) Mocha runs tests in Node.js, therefore you can use and test any es6 feature which is implemented in the node. Check out supported features for your node version: https://node.green/

Rename file based on regex in Gulp

大兔子大兔子 提交于 2019-12-05 08:30:34
Say I have a LESS CSS directory structure like this: less/ core/ _main.less header.less body.less footer.less contact/ _main.less form.less details.less I want to write a Gulp task that will look for the _main.less files in each subdirectory of the less/ dir, pass this to gulp-less and write the output to the css/ dir like this: css/ core.css contact.css Because _main.less includes the other files in it's directory, only the _main.less files will have to be parsed, but I want the output file to have the name of the directory it's in. So far I have this: gulp.src('less/*/*/_main.less') .pipe

Gulp Uglify Options not applying

人盡茶涼 提交于 2019-12-05 08:26:59
Hi I am making a theme for the company i work at and the JS segments will not build properly in uglify. I am trying to use uglify to simply concatenate my files, which works but they output minified and mangled with no comments and i cannot figure out why, below is my gulp task which runs correctly but doesnt output with the options provided gulp.task('js', function() { return gulp.src('./src/js/*.js') .pipe(uglify({ options: { mangle: false, beautify: true, comments: true } })) .pipe(rename('cf247bootstrapTheme.js')) .pipe(gulp.dest('./dist/js')); }); Any ideas why this is happening? Thanks,