草庐IT

gulp-data

全部标签

javascript - 使用 gulp 进行丑化时,Angular-ui-router 会中断

我有以下简单的angular.js应用程序,遵循概述的最佳实践here.angular.module('myApp',['ui.router']);(function(){functionroutes($stateProvider,$urlRouterProvider){$urlRouterProvider.otherwise("/404");$stateProvider.state('createCluster',{url:'/create-cluster',templateUrl:'templates/create-cluster.html'})}angular.module('m

javascript - 我用 gulp 收到 Malloc 错误

有趣的是我是如何使用gulp得到内存分配错误的,不管错误的输出是什么:gulpcompile:development[15:33:51]Warning:gulpversionmismatch:[15:33:51]Globalgulpis3.8.7[15:33:51]Localgulpis3.8.6[15:33:52]Usinggulpfile~/Dropbox/AisisGit/Zen/gulpfile.js[15:33:52]Starting'bower'...[15:33:52]Usingcwd:./[15:33:52]Usingbowerdir:./bower_component

javascript - 使用来自 Typescript 的 react-meteor-data

问题:我如何在Typescript中使用react-meteor-data?背景:我刚开始一个新项目,想使用Meteor。根据我一直在阅读的内容(link),建议似乎是将React与Meteor一起用于新项目。太好了,无论如何我都想学习React。因为我是一名Java程序员,所以我非常喜欢使用Typescript。但是我在这三项技术上遇到了很多麻烦。具体来说,我如何将React组件连接到meteor容器?我相信我应该使用react-meteor-data但如果我运行typingssearchmeteoraddreact-meteor-data我一无所获。我从这里去哪里?额外学分:我真正

javascript - Gulp 监视任务不会在 Ctrl C 上退出

背景我有这个gulpwatch任务来处理sass编译:importgulpfrom'gulp';importsassfrom'gulp-sass';importconcatfrom'gulp-concat';gulp.task("compile-scss",()=>{returngulp.src("assets/scss/**/*.scss").pipe(sass({outputStyle:'compressed'}).on("error",sass.logError)).pipe(concat("style.css")).pipe(gulp.dest("dist/css"));});

javascript - gulp 是否对 javascript 文件进行代码拆分?

我正在使用gulp,我想知道它是否具有代码拆分功能。类似于webpacksite中提到的内容.我在网上看过,但没有看到任何专门用于此的内容。 最佳答案 我在网上找到这个gulp-split-files,我希望这能解决您的问题。正如作者在文档中所说的那样。在你的gulpfile中:constgulp=require("gulp");constsplitFiles=require("gulp-split-files");gulp.task("split",function(){returngulp.src("superMegaBigCs

javascript - 拖动 : Replacement of the data

我得到了一个包含一些html元素的网页,其中包括一个文本区域和一个嵌入式contenteditableiframe(一个rte)。使用这段代码,我设法在主页上捕获拖动手势事件并设置文本/html数据jQuery(document).bind('draggesture',function(event){event.originalEvent.dataTransfer.setData('text/html','my_data');});现在,当拖放到主页上的文本区域时,“my_data”会被丢弃。放入contenteditableiframe也会掉落“my_data”。但是我在这里遇到了三

javascript - JSON.解析 : unexpected non-whitespace character after JSON data

我希望创建一个从4个选择菜单的选定选项派生的JSON对象。这些菜单可能在加载时选择了选项(由于服务器端技术)或者可能没有选择任何选项!使用$(document).ready()加载页面后,我的脚本就会运行……但是我遇到了JSON对象的一些问题“JSON.parse:JSON数据后出现意外的非空白字符”我希望我的JSON具有以下结构selObj={category:selectedCategory,//wecanonlyhave1category,thisisn’tgivingmeaproblem…catOptions:{optionValue:discountValue,//wecan

javascript - Gulp Connect 未运行服务器

我创建了gulpfile.js并在其中使用了gulp-connectgulp.task('connect',function(){connect.server({root:'dev',livereload:true,port:8000});})当我运行gulpconnect时,它不会在localhost:8000上维护我的服务器。[14:08:51]Starting'connect'...[14:08:51]Serverstartedhttp://localhost:8000[14:08:51]LiveReloadstartedonport35729[14:08:51]Finished

javascript - 将 base64 图像转换为 multipart/form-data 并使用 jQuery 发送

我在javascript中有一个base64编码的jpg,我想将其发布到需要multipart/form-data的服务器。特别是关键跟踪器API,它有一个示例curl调用,如下所示:curl-H"X-TrackerToken:TOKEN"-XPOST-FFiledata=@/path/to/file\http://www.pivotaltracker.com/services/v3/projects/PROJECT_ID/stories/STORY_ID/attachments我有基本的XML只调用他们的API工作正常,使用.ajax像这样:$.ajax({url:'http://w

javascript - gulp-useref – 不同级别文件夹中的相对输出路径

目前有没有办法做相对输出路径?内gulp-useref还是其他?我的现状:project_folder/app/index.htmlabout/index.htmlscripts/index.jsabout.js在index.html基于app/,一切正常:index.html文件位于scripts旁边文件夹,以便相对路径正确同步。但这是about/index.html:如果我像这样传递路径–../scripts/about.min.js–生成的about.min.js获取输出太远的一个文件夹,导致这种情况:project_folder/scripts/about.min.jsdist