gulp

NativeScript Sidekick - UnhandledPromiseRejectionWarning: primordials is not defined

时间秒杀一切 提交于 2019-12-06 14:01:55
When starting up NativeScript Sidekick, I am presented an exception from the Windows stating the following (this error message also shows up in the output Errors in Sidekick): UnhandledPromiseRejectionWarning: ReferenceError: primordials is not defined (for easier reading the full stack trace of the error can be found at the bottom) I have literally not done anything except install NativeScript Sidekick and open the application. How do I resolve this issue? (CLI) (node:6632) UnhandledPromiseRejectionWarning: ReferenceError: primordials is not defined at fs.js:27:35 at req_ (userFolder\AppData

npm i and npm update breaking gulp, browserify builds

自闭症网瘾萝莉.ら 提交于 2019-12-06 13:28:59
What were you expecting to happen? Gulp to transpile vue.js components into usable and functional JS. What actually happened? When I run gulp contacts (shown under the Code and Configuration section below), the transpiling runs fine. No errors are outputted in the terminal, and everything appears to complete successfully. The problem is, when the page is reloaded I have an error in the console stating Uncaught SyntaxError: Unexpected end of input . When looking at the source, devtools shows something along these lines: module.exports = function parseHeaders(headers) { var parsed = {}; var key;

Get current file name in Gulp Stream

徘徊边缘 提交于 2019-12-06 12:49:45
问题 I've read Get the current file name in gulp.src(), and it seems like it's approaching what I am attempting to do, but I need help. Consider the following function in a gulpfile.js : function inline() { return gulp.src('dist/**/*.html') .pipe($.if(PRODUCTION, inliner('dist/css/app.css'))) .pipe(gulp.dest('dist')); } And inliner() , to be thorough (also in the gulpfile ): function inliner(css) { var css = fs.readFileSync(css).toString(); var mqCss = siphon(css); var pipe = lazypipe() .pipe($

关于脚手架

独自空忆成欢 提交于 2019-12-06 12:20:20
前端开发中提到的“脚手架”到底指什么,CLI?gulp 和 gulp-cli有什么区别 作者:flowmemo 链接:https://www.zhihu.com/question/47731497/answer/107667684 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 一般来说,脚手架是帮你减少「 为减少重复性工作而做的重复性工作 」的工具. gulp和gulp-cli的区别可以看这个 task - what does gulp-"cli" stands for? . 它跟前端常说的脚手架(scaffold)不是一个东西. CLI只是Command Line Interface的缩写. ==== 举个例子 你要写一个项目0,源语言为ES6,用了sass, 后端是node. 你每次完成一部分功能,你都要用把ES6编译到ES5、编译sass、压缩html文件. 每次修改代码都要做的编译ES6、sass、压缩html这些就是 重复性工作. 后来你知道了gulp, 然后你写了个gulp脚本,每次有代码改动,一句gulp build就帮你完成了上面说的这些重复性工作. 你写的gulp脚本就是 为减少重复性工作而做的工作. 你写完这个项目0之后,你又要写项目1,还是ES6、sass、后端node,还要完成之前的那些重复性工作.

使用gulp构建项目

会有一股神秘感。 提交于 2019-12-06 12:16:34
一.环境准备 1.1 gulp介绍 gulp是基于node.js 文件流的一个前端自动化构建工具,可以使用它构建自动化工作流程,简化工作量 官方定义: 基于文件流的构建系统 核心文件: gulpfile.js 和 package.json gulpfile.js:任务脚本 package.json:任务配置文件 1.2 安装gulp npm install gulp -g 1.3 构建项目 (1)切换到项目根目录(即 gulpfile.js 所在目录),命令行安装任务所依赖的包: npm install (2)安装完成后,即可直接执行命令: gulp 二.使用实例 - 打包js和css 2.1 在 package.json 中引用依赖 gulp-minify-css 和 gulp-uglify "devDependencies": { "del": "^2.2.2", "gulp": "^3.9.1", "gulp-header": "^1.8.8", "gulp-minify-css": "^1.2.4", "gulp-replace": "^0.6.1", "gulp-uglify": "^1.5.4" } 2.2 定义我们第一个gulp流程 var pkg = require('./package.json'); var del = require('del'); var

package.json理解

你说的曾经没有我的故事 提交于 2019-12-06 12:12:44
1.作用和示例 每个项目的根目录下面,一般都有一个package.json文件,定义该项目所需要的各种模块,以及项目的配置信息(比如名称、版本、许可证等元数据)。 npm install 命令根据这个配置文件,自动下载所需的模块,即配置项目所需的运行和开发环境。 { "name": "firstProj", "version": "1.0.1", "description": "第一个项目", "license": "GPL", "author": [ "xiaotang <i@rumoss.cn>" ], "homepage": "http://www.rumoss.cn", "devDependencies": { "del": "^2.2.2", "gulp": "^3.9.1", "gulp-concat": "^2.6.0 ", "gulp-header": "^1.8.8", "gulp-if": "^2.0.1", "gulp-minify-css": "^1.2.4", "gulp-rename": "^1.2.2", "gulp-replace": "^0.6.1", "gulp-uglify": "^1.5.4", "minimist": "^1.2.0" } } 2.package.json详解 name :名称 version :版本号

gulp Segmentation fault: 11 and Abort trap: 6 OSX Yosemite

人盡茶涼 提交于 2019-12-06 12:02:48
问题 We've been running on gulp with a set of tasks, with browser-sync and gulp.watch to reload the browser when files are changed. Increasingly I've been seeing more and more Segmentation fault: 11 and Abort trap: 6 intermittently on 2 different projects. The gulp task layout is a derivative of this: https://github.com/notbrain/viceroy I really have no idea where to start pinpointing the culprit besides whittling down the set of tasks to run until I run into the issue when only running a single

Compile JavaScripts with Gulp and Resolve Dependencies (separate files)

瘦欲@ 提交于 2019-12-06 11:54:34
I want to compile JavaScript files with Gulp. I have a src directory where all scripts are present with .js extension. I want all scripts to be compiled separately and placed into a destination directory ( dist ) with the same filename as the original. Consider this example: src/jquery.js : /** * @require ../../vendor/jquery/dist/jquery.js */ src/application.js : /** * @require ../../vendor/angular/angular.js * @require ../../vendor/ngprogress-lite/ngprogress-lite.js * @require ../../vendor/restangular/dist/restangular.js * @require ../../vendor/lodash/dist/lodash.underscore.js * @require ../.

Babel Config “strict mode”

这一生的挚爱 提交于 2019-12-06 11:45:53
For some strange reason I can't for the life of me compile "vendor" libraries with my build process. Im getting this error: SyntaxError: <FILENAME> 'with' in strict mode . (where <FILENAME> is an actual existing filename) The line that's failing is > 130928 | with (locals || {}) { (function(){ and its complaining about that with . Bear in mind that this file is outside my control. My .babelrc file has this config. { "compact": true, "plugins": [ "transform-runtime", "undeclared-variables-check" ], "presets": [ "es2015", "stage-0" ] } I'm using babel 6, I know the general conscious is to use

Gulp: how to get gulp result as variable

谁都会走 提交于 2019-12-06 11:24:46
Needed something like this: gulp.src(path.join(conf.paths.src, '/**/*.less')) .pipe($.less()) // already have some result, but HUGE changes are needed .pipe(HERE_I_GET_IT_AS_A_TEXT(function(str){ // a lot of different changes return changed_str; })) .pipe(rename('styles.css')) // go on doing smth with changed_str .pipe(gulp.dest('./app/theme/')); Is there something in gulp to get some transitional result as text, process text with js and pass it to the next pipes? Everywhere I find only solution with reading files directly, this way is pointless for me. Use map-stream : var gulp = require(