gulp

gulp-typescript: Problems using createProject

↘锁芯ラ 提交于 2019-12-13 01:14:52
问题 I have been trying to use gulp-typescript with some degree of success but I have a small issue. All my code is stored under 'src' and I want these to be compiled to '.tmp' but without the 'src' being included. here is my code, I think the issue is that passing a value (glob) to tsProject.src isn't supported so I get /.tmp/src/aTypescriptFile.js for example This code I got directly from the github repo, what I really didn't understand is why gulp.src is replaced with tsProject.src Any ideas ?

Can I run a Gulp task written in ES6 using Node?

廉价感情. 提交于 2019-12-13 00:29:13
问题 I'm using ES6 on Node through Babel. I can run ES6 scripts using a run-babel script. So, this will work: node run-babel build.js //build.js is written in ES6 But now I'd like to access one of these ES6 scripts from a Gulp task but Gulp runs on vanilla node. Is there a way I can write Gulp tasks in ES6 回答1: You can first go into node_modules/gulp/bin/gulp.js and edit the first line to become #!/usr/bin/env node --harmony . This will invoke gulp in node harmony mode. Then you can run node

gulp-assemble & gulp-watch not recompiling site when changes are made to data, includes or layouts

浪子不回头ぞ 提交于 2019-12-13 00:27:54
问题 I'm having issues using gulp-assemble with gulp-watch . I want gulp to watch the entire assemble source directory ( data , includes , layouts and pages ) and recompile the site when ever a file changes. I'm able to get this working correctly for pages , but gulp is not recompiling the site when changes are made to the data , includes or layouts files. I've added a watch task to the example gulpfile.js in the gulp-assemble repository: var gulp = require('gulp'); var htmlmin = require('gulp

Gulp-cdnizer - Not replacing source links

做~自己de王妃 提交于 2019-12-12 23:34:08
问题 I'm trying to get gulp-cdnizer to work but all it does is take in the file and spits out the file unprocessed to the destination folder. Perhaps my option settings are wrong or the gulp task isn't working. How do you configure the gulp-cdnizer to work with a custom bower_components path? Gulp task: gulp.task('makeCdn', function () { return gulp.src('./app/**/*.html') .pipe(cdnizer({ bowerComponents: './vendor/bower_components', allowRev: true, allowMin: true, files: [ { file: '/vendor/bower

Unable to run project under Gulp

爷,独闯天下 提交于 2019-12-12 22:36:26
问题 I'm new to front-end development and I have some existing project which I unable to run. Documentation says, to run the project I should execute: $ gulp && gulp serve However, I receive the following error: /home/alex/some/project/node_modules/@types/gulp/index.d.ts(15,15): error TS2430: Interface 'Gulp' incorrectly extends interface 'Orchestrator'. Types of property 'task' are incompatible. Type 'AddMethod' is not assignable to type '{ (name: string): Task; (name: string, fn: TaskFunc): void

GulpUglifyError: unable to minify JavaScript (Angular 4)

谁都会走 提交于 2019-12-12 21:53:11
问题 I have a problem with uglify main bundle.js file. This is my gulp scripts: gulp.task("compile", () => { let tsResult = gulp.src("app/**/*.ts") .pipe(sourcemaps.init()) .pipe(tsProject()); return tsResult.js .pipe(sourcemaps.write(".", { sourceRoot: '/app' })) .pipe(concat('bundle.js')) .pipe(gulp.dest('app/_Dist/')); }); gulp.task("minify", ["compile"], function () { return gulp.src(['app/_Dist/bundle.js']) .pipe(concat('bundle.min.js')) .pipe(plumber()) .pipe(uglify()) .on('error', function

Gulp globbing excluding files then unexcluding not working as described

走远了吗. 提交于 2019-12-12 20:15:43
问题 If I have the files client/ a.js bob.js bad.js And the gulp task gulp.task('copy', function() { return gulp.src(['client/*.js', '!client/b*.js', 'client/bad.js']) .pipe(gulp.dest('public')); }); then according to the documentation we should copy a.js and bad.js . However, when I run this with gulp v3.9.1, it only copies a.js . Is this a known bug? Is there a way to do this? 回答1: It's not a bug, the documentation is just wrong. The newest version of gulp is gulp@3.9.1 which uses vinyl-fs@0.3

How to load minified file in angular 2 using gulp uglify ? (which minifies TYpescript Bundled File)

有些话、适合烂在心里 提交于 2019-12-12 19:22:31
问题 I have a angular 2 application in which typescript compiler options is defined to generate a single outFile which is Scripts1.js and Scripts1.js.map Now in my index.html <script src="Scripts/Script1.js"></script> <script> System.config({ packages: { 'V1/components/main': { format: 'register', defaultExtension: 'js', defaultJSExtensions: true } } }); debugger; //System.import('Scripts/main') System.import('V1/components/main') .then(null, console.error.bind(console)); </script> Which is

How can I extract filename from gulp-contains callback?

主宰稳场 提交于 2019-12-12 19:14:50
问题 I am using gulp-contains to check for specific string and if that string is found I want to throw an error like "String found in file abc". the file param contains the whole object containing filename + Buffer but I don't know how can I extract filename from file object in gulp? .pipe(contains({ search: 'myString', onFound: function (string, file, cb) { console.log(file); var error = 'Your file "' + file + '" contains "' + string + '", it should not.'; cb(new gutil.PluginError('gulp-contains'

angular 2 multiple times error TS2300: Duplicate identifier

ε祈祈猫儿з 提交于 2019-12-12 18:35:54
问题 system configuraions ubuntu 14.04 node -v => v5.6.0 npm -v => 3.7.1 typings latest version (don't know how to get version detail) while working with angular2 first time on my folder sample/server structure is below |-- server.js |-- server.ts |-- tsconfig.json |-- typings | |-- browser | | `-- ambient | | |-- express | | | `-- express.d.ts | | |-- mime | | | `-- mime.d.ts | | |-- node | | | `-- node.d.ts | | `-- serve-static | | `-- serve-static.d.ts | |-- browser.d.ts | |-- main | | `--