gulp

Gulp JS with live reload - what gets reloaded

核能气质少年 提交于 2019-12-08 10:44:04
问题 I am testing Livereload with gulp.js and the Chrome extension for livereload. My gulpfile.js // gulpfile.js var gulp = require('gulp'), livereload = require('gulp-livereload'); gulp.task('watch', function() { var server = livereload(); gulp.watch(['dist/**']).on('change', function(file) { server.changed(file.path); }); }); In the dist folder, there are 5 files index.html (main page) app.css (css linked from index.html) app.js (javascript linked from index.html) include.html (angularjs partial

Laravel + Elixir: importing bootstrap less error

喜你入骨 提交于 2019-12-08 09:21:18
问题 I've installed bootstrap with bower into /vendor/bower_components folder. Also I have an app.less file with this import: @import '/vendor/bower_components/bootstrap/less/bootstrap'; For the time being it worked, when I run gulp I got public.css compiled and everything went good. However, I've reinstall npm/nvm/gulp/bower and such stuff and after then I got an error when running gulp : [15:19:07] gulp-notify: [Laravel Elixir] Less Compilation Failed!: '/vendor/bower_components/bootstrap/less

Switch output folder based on filename in gulp task

自作多情 提交于 2019-12-08 09:12:19
问题 I have different *.scss files in my src folder and I want one file to be compiled in its own separate folder. Lets assume I have the files normalFile_1.scss , specialFile.scss , normalFile_2.scss . I want the two normal files to be compiled to the folder Public/Css , the special file however should end up in the folder Public/Css/Special . I have tried to get the current filename in the task with gulp-tap , which works fine. .pipe($.tap(function (file, t) { filename = path.basename(file.path)

es6基础和彩票实战——es6运行环境搭建

六月ゝ 毕业季﹏ 提交于 2019-12-08 09:06:03
1、查看node npm express是否安装 2、项目目录创建(如下例子) mkdir es6 cd es6/ mkdir app mkdir server mkdir tasks cd app/ mkdir css mkdir js mkdir views ls mkdir js/class touch js/class/test.js touch js/index.js touch views/error.ejs 当做HTML使用 touch views/index.ejs cd ../server/ express -e . 使用ejs模板引擎 使用这个错误 说明你express没有安装好 npm install clear cd ../tasks/ mkdir util touch util/args.js clear cd ../ npm init y touch .babelrc touch gulpfile.babel.js clear 整个项目的目录大概如上 主要是完成tasks中的js文件 args .js browser.js build.js clean.js css.js default.js pages.js scripts.js server.js js 代码完成后,inport的文件都需要进行安装 npm install gulp gulpif

Getting Libsass Gulp Susy to work together

拈花ヽ惹草 提交于 2019-12-08 08:43:31
问题 I have just spent the last 5 days playing with this and trying to get the following to work together: ¬ Libsass ¬ Susy ¬ Gulp But now I have it working I have just gone for 45s to 700ms This is something I feel I should share. Initial Problem Gulp gulp.task('sass', function () { return gulp.src('./frontend/sass/style.scss') .pipe(sass({ 'require':'susy' })) .pipe(gulp.dest('./app/www/css')) }); Sass @import "susy"; Inital Error [23:58:08] Starting 'sass'... stream.js:94 throw er; // Unhandled

How to reference own css file in ASP.NET 5?

落花浮王杯 提交于 2019-12-08 07:04:38
问题 I am trying to load a file called styles.css which is located in ~/Content/css/styles.css What I tried is adding it to the _Layout page <link rel="stylesheet" href="~/Content/css/styles.css" /> This gives a 404 on that location. I like the way how bower handles external libraries and gulp magically does all the other stuff like minifying a file when I request a minified version, but through all this newness I cannot add a simple static file of my own. Could someone be so kind to help me

Gulp task to create a DEV and PROD version of main.js

我们两清 提交于 2019-12-08 05:07:41
问题 Im new to Gulp and have been playing with gulp-minify and gulp-uglify to create an overall main.js file via gulp-requirejs . However, i need to create 2 versions of this main.js file, one for my DEV environment, and one for PROD. Reason being, in some .js files, i have listed URLs, for example: currentPage == '/products/chairs.html' However, when moving these html files into my .Net structure, the actual URL is: currentPage == 'goodsandservices/products/our-chairs.html' My current rJS task is

Everytime I get an Assertion error while running gulp in command line

匆匆过客 提交于 2019-12-08 04:57:31
问题 I'm trying to run the command below but unfortunately I run into an error. C:\Users\usver\Desktop\git test\git\Bootstrap4\conFusion>gulp I got assertion error after running the above command. I reinstalled gulp and npm once again but got the same error. My node version-v10.15.0 gulp version- CLI version 2.0.1 Local version 4.0.2 assert.js:350 throw err; ^ AssertionError [ERR_ASSERTION]: Task function must be specified at Gulp.set [as _setTask] (C:\Users\usver\Desktop\git test\git\Bootstrap4

Problems generating source map files with current Gulp setup

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 04:40:29
I have set up a gulpfile.js in my project. It's working pretty nicely mostly, except when it comes to generating source maps, especially for the LESS files it compiles to CSS . I have put together a gist which contains all the files in my gulp setup. Please note that other than the gulp file.js itself, all the other files are inside a directory called tasks . The problems I am having are that I had to disable the autoprefixer in development because the source maps that were being generated were invalid as the autoprefixer modified the original CSS file after the source maps were generated. To

Gulp merge json files from different folders while keeping folder structure

强颜欢笑 提交于 2019-12-08 04:23:28
I would like to merge multiple .json files from different folders while keeping the general folder structure. Input /lang/module1/file1.json /lang/module1/file2.json /lang/module2/file1.json /lang/module2/subModule1/file1.json /lang_additional/module1/file1.json /lang_additional/module1/file2.json /lang_additional/module2/file1.json /lang_additional/module2/subModule1/file1.json Expected Output /dist/lang/module1/file1.json (both file1.json's merged) /dist/lang/module1/file2.json (both file2.json's merged) /dist/lang/module2/file1.json (both file1.json's merged) /dist/lang/module2/subModule1