gulp

Polymer: gulp error at build time: merge-stream

独自空忆成欢 提交于 2019-12-12 04:32:10
问题 I'm trying to run gulp to build my app like Rob Dodson explains here, but I get the following error: module.js:327 throw err; ^ Error: Cannot find module 'merge-stream' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (/Users/path/to/gulpfile.js:16:21) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at

Globbing in template path not working in nunjucks with gulp

谁说胖子不能爱 提交于 2019-12-12 04:29:49
问题 I'm using this gulp plugin to use nunjucks to make HTML management easier. https://github.com/carlosl/gulp-nunjucks-render gulp.task('default', function () { return gulp.src('src/templates/*.html') .pipe(nunjucksRender({ path: ['src/templates/'] // String or Array })) .pipe(gulp.dest('dist')); }); I want to keep my templates and partials of specific pages under page's directory in different folders so I tried this to keep the path as path: ['src/templates/', 'src/common-partials/', 'src/pages

Pass parameter to Gulp task in gulpfile.js (not command-line)

折月煮酒 提交于 2019-12-12 04:26:15
问题 EDIT: As I wrote IN THE TITLE AND FROM THE BEGINNING, this is not about command-line parameters and is thus NOT A DUPLICATE. //EDIT I have a Sass setup with an indefinite number of uniquely-designed pages (page_1, page_2, etc), each having their own sass/pages/page_1/page_1.scss file. The pages all belong to the same website, and each page's sass file @import s the same set of files from a sass/includes folder. With a basic gulp task watching sass/**/* , every page's styles get compiled

How to ignore a particular bower component being installed which is dependent on other bower component

别说谁变了你拦得住时间么 提交于 2019-12-12 04:23:36
问题 I am trying to install ng-quill which takes quill as its dependency which I do not want to install and use cdn instead, due to some compilation issue, just trying if this can help. Bower component Quilljs editor module (ES6) is failing while running gulp build "overrides": { "ngQuill" : { "dependencies" : [] } } 回答1: I think this SO answer has the solution to your problem. It boils down to adding the following to your .bowerrc : { "ignoredDependencies": [ "quill" ] } 来源: https://stackoverflow

Browser sync not working with gulp when SASS updated

会有一股神秘感。 提交于 2019-12-12 04:11:06
问题 I have a gulpfile with browser sync running and js/sass compiling. It serves my Angular SPA. It looks like this: gulp.task('default', function(){ return runSequence(['build-css', 'build-js'], 'serve-dev'); }); gulp.task('serve-dev', function() { browserSync.init(null, { server: { baseDir: './', middleware: [ modRewrite([ '!\\.\\w+$ /index.html [L]' ]) ] } }); gulp.watch(paths.js.dir + '/**/*.js', ['watch-js']); gulp.watch(paths.css.dir + '/**/*.scss', ['watch-css']); gulp.watch(paths.html.dir

minify es2017 with gulp

自古美人都是妖i 提交于 2019-12-12 03:50:23
问题 Hey guys I'm currently using uglify-gulp with babel to minify my js. And it works great with es2015 and es2016. But it breaks if I try to do es2017. Does anyone know any workarounds to minify js that is using the new experimental features in es2017? gulp.src('build/js/bundled/bundle.js') .pipe(babel({ compact: false, presets: ["es2017", "react"], plugins: ["transform-decorators-legacy"], })) .pipe(uglify()) .pipe(gulp.dest('build/js/bundled')); which generates this error GulpUglifyError:

Get “file basename” in gulp-replacer-task

陌路散爱 提交于 2019-12-12 03:33:39
问题 I'm manipulating a set of files and I am using gulp-replacer-task to replace the content of processed files with "strings" based on the basename or path of the file currently in the pipe-line. How do i get at the file's properties currently in the pipe-line ? gulp.task('svgbuild', function() { return gulp.src('./src/*.svg') .pipe(replace({ patterns: [ { match: /STRING_TO_MATCH/g, replacement: function() { // how to get the basename of the "file" in the stream; var str = 'file.basename' //

Gulp throwing “is read-only while parsing file” error while running Gulp task

柔情痞子 提交于 2019-12-12 03:26:42
问题 I'm trying to create ES6 module in JavaScript and I get error like: Line 20: "NotFound" is read-only while parsing file . The NotFound is the name of my module. 'use strict'; import React from 'react'; const NotFound = React.createClass({ render: function () { return ( <h1>Not Found!</h1> ); } }); export default NotFound; I'm importing it the following way: import NotFound from './components/NotFound'; How to solve this issue? Changing file rights to 777 doesn't help at all (I know it's

Accessing typescript file variable values using gulp

こ雲淡風輕ζ 提交于 2019-12-12 03:25:20
问题 I have several typescript files, some of them export a const named APIS . I'm trying to access those exports (I want to concatenated all of them to a single file), but it doesn't seem to work. I'm obviously doing something wrong, but I'm not sure what. For example, I have a folder named services, with 2 files: service1.ts, service2.ts. service1.ts: ... export const APIS = [ { "field1" : "blabla" } ]; service2.ts: does not contain the APIS var. This is my gulpfile.js: var gulp = require('gulp'

Gulp doesn't ignore SASS partials with underscore

旧巷老猫 提交于 2019-12-12 03:24:50
问题 My tasks are as follows: gulp.task('sass', function () { gulp.src(paths.webroot + '/css/**/*.scss') .pipe(sass().on('error', sass.logError)) .pipe(gulp.dest(paths.webroot + '/css')); }); gulp.task('sass:watch', function () { gulp.watch(paths.webroot + 'css/**/*.scss', ['sass']); }); My folder structure: css libs _partial1.scss _partial2.scss main.scss How can I ignore all files with underscore or go after only top level files in css (ignoring libs ) 回答1: To go after only top level files in