Tag: gulp

在生产版本上不要创buildCSS文件夹

我有一个使用两个gulpfiles编译的静态网站。 一个是gulpfile.dev.js ,它能够正确编译所有文件,并使用浏览器gulpfile.dev.js服务的静态服务器。 gulpfile.prod.js与dev文件完全相同,只是没有browsersync服务器。 当我使用DeployHQ编译我的文件来移动我的服务器上的文件时,它不编译必要的css文件夹。 我的gulpfile.prod.js文件: //DH var gulp = require('gulp'), //Task runner uglify = require('gulp-uglify'), //Minimizies JS sass = require('gulp-ruby-sass'), //Compiles to CSS imagemin = require('gulp-imagemin'), // Minimize images concat = require('gulp-concat'), concatCss = require('gulp-concat-css'), gutil = require('gulp-util'), autoprefixer = require('gulp-autoprefixer'), cssnano = require('gulp-cssnano'), pug = require('gulp-pug'), htmlmin = require('gulp-htmlmin'); // Define paths for […]

在VS2015 asp.net核心1.0项目中将文件从node_modules移动到wwwroot

当我创build一个新的ASP.NET Core 1.0应用程序时,我想使用npm而不是bower。 所以我删除了bower.json,并且另外删除了在wwwroot / lib文件夹中预先安装的所有东西。 我用下面的开发依赖项添加一个package.json文件到我的解决scheme: "devDependencies": { "bootstrap": "3.3.7", "jquery": "3.1.0", "jquery-validation": "1.15.1", "jquery-validation-unobtrusive": "3.2.6" } 但是,NPM会将所有库下载到我的项目根目录中的node_modules文件夹中。 我相信这是Gulp的目的。 有人可以告诉我如何使用gulp将分发文件从node_modules发送到我的wwwroot目录。 如果有任何我无法find的教程,请链接。

.pipe调用一个gulp插件时,会发生什么?

例如,这里是一个简单的gulp插件 'use strict'; var match = require('gulp-match'); var ternaryStream = require('ternary-stream'); var through2 = require('through2'); module.exports = function (condition, trueChild, falseChild, minimatchOptions) { if (!trueChild) { throw new Error('gulp-if: child action is required'); } if (typeof condition === 'boolean') { // no need to evaluate the condition for each file // other benefit is it […]

节点js,生成dist文件夹,html页面包含链接不工作

我在我的项目中使用node.js + angular js,我生成dist并从服务器上的dist文件夹运行。 本地我使用gulp手表和运行localhost:9000端口没有产生dist和它的工作正常,但是当我上传在服务器上,它从dist获得,包含的链接不工作。 我包括链接自动完成谷歌地方是链接https://maps.googleapis.com/maps/api/js?libraries=places 我怎样才能解决这个问题?

events.js:160扔呃; //未处理“错误”事件 – 错误:spawn npm ENOENT

操作系统:Windows 10专业版 节点:6.5.0 NPM:3.10.3 Gulp:CLI版本3.9.1 所以我在接收下面的错误,只在窗口,在runSequence (生成)过程中,当发射进程的runSequence 。 任何想法如何解决它? [14:44:57] Finished 'eslint-ci' after 18 s [14:44:57] Starting 'ava'… events.js:160 throw er; // Unhandled 'error' event ^ Error: spawn npm ENOENT at exports._errnoException (util.js:1026:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:359:16) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) 代码如下: import runSequence from 'run-sequence'; gulp.task('to-html', done => { args.production […]

NodeJS Gulp要求没有定义

我想在我的web应用程序上使用系统命令。 这是我的脚本 var gulp = require('gulp') var shell = require('gulp-shell') gulp.task('example', function () { return gulp.src('*.js', {read: false}) .pipe(shell([ 'echo <%= f(file.path) %>', 'ls -l <%= file.path %>' ], { templateData: { f: function (s) { return s.replace(/$/, '.bak') } } })) }) 但我得到了 notice.js:1 Uncaught ReferenceError: require is not defined

吞噬服务未处理的错误

所以我的朋友在github上创build了仓库。 我们正在使用yeoman。 所以我克隆它在我的电脑上,并按照从https://github.com/yeoman/generator-webapp指示。 问题开始时,我使用gulp服务,我得到以下错误: $ gulp serve [10:00:33] Using gulpfile D:\Projekti programiranje\PracticeBand\gulpfile.js [10:00:33] Starting 'serve'… [10:00:33] Starting 'clean'… [10:00:33] Starting 'wiredep'… [10:00:33] Finished 'wiredep' after 18 ms [10:00:33] Finished 'serve' after 27 ms [10:00:33] Finished 'clean' after 32 ms [10:00:33] Starting 'styles'… [10:00:34] Starting 'scripts'… [10:00:34] Starting 'fonts'… events.js:160 throw er; // Unhandled 'error' event […]

npm install throwing“path must be string”TypeError

第一次尝试node.js – 我碰到了一个绊脚石 – 我希望有人能帮助我:) 我试图安装任何与npm install在这个例子中,我正在运行到这个错误,我试图安装mongoose 。 谷歌似乎没有让我到任何地方。 ➜ Beta git:(dev) ✗ npm install mongoose –save npm WARN deprecated find-file@0.1.4: Use the globby package instead > gifsicle@0.1.7 postinstall /Users/e042481/Projects/Beta/node_modules/gifsicle > node index.js path.js:7 throw new TypeError('Path must be a string. Received ' + inspect(path)); ^ TypeError: Path must be a string. Received { url: […]

SASS的节点和吞吐量 – 堆栈级别太深

尝试使用Gulp将我的SASS编译到.css文件中用于使用指南针,并希望切换到Gulp。 下面这个mixin不是由我创build的,而是正在使用。 其中一个头文件使用mixin bp(做一个断点) 而且这些问题有时也会发生,有时在Gulp运行sass编译时不会发生。 并不总是一样的精确点再现。 我也删除了css文件,并重新编译这个错误。 CSS仍然在那里,似乎工作。 我该怎么办? 思考? 错误插件'sass' 消息:afa / scss / layout / _header-search.scss SystemStackError:堆栈级别太深 on line 41 of afa/scss/layout/_header-search.scss —> @include bp(min-width,$ bp-medium + 1){——— ^ 下面是来自文件本身的Mixin // ============================================= // Mixin – Breakpoint // ============================================= $mq-support: true !default; $mq-fixed-value: 1024px !default; @mixin bp($feature, $value) { // Set global device param […]

我可以转换成一个string的gulpstream吗?

我想在gulpstream中应用一些任务并获取输出string。 我不想创build一个新的文件。 这是我的代码: function buildCSS() { // READ A FILE AND APPLY SOME TASKS var content = gulp.src(__dirname + '/src/styles.less') .pipe(g.less()); if (environment === 'live') { content.pipe(g.minifyCss()); } // I NEED RETURN A STRING return content; } gulp.task('build-html', function() { // I SHOULD GET THE CSS TEXT var cssText = buildCSS(); gulp.src(__dirname + '/src/template.html') // […]