gulp-concat

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'

How to order the compiling of javascript files in Gulp

五迷三道 提交于 2019-12-12 03:22:22
问题 Hi I'm trying to fix the order of the js files that get compiled in my Gulp task. The order I need: '/_sources/js/libs/*.js' '/_sources/js/plugins/*.js' '/_sources/js/custom/*.js' '/_components/*.js' Issue is that the custom folder contains a custom particlesJS script and the main particlesJS script is inside the plugins folder. So if the custom script ends up above the main particlesJS in the compiled js file everything breaks. I tried to re-order things with gulp-order and event-stream but

Gulp stream inside a for loop not working properly

烂漫一生 提交于 2019-12-11 10:49:20
问题 I have a gulp task similar to the following. I am trying to loop through and append a string to the page and also concatenate a corresponding file. gulp.task('loop', function() { for(i =0; i < 10; i++) { gulp.src('./build/ross/templates/pages/_page_home.liquid') .pipe(plugins.insert.append('Loop ' + i)) // real example has concat here .pipe(plugins.addSrc('./src/page/_page' + i + '.liquid')) .pipe(plugins.concat('_page_home.liquid')) .pipe(gulp.dest('./build/ross/templates/pages/')); } });

how to debug gulp-sourcemaps not doing anything?

梦想与她 提交于 2019-12-10 14:47:52
问题 I have a fairly standard use case for gulp-sourcemaps https://github.com/floridoo/gulp-sourcemaps gulp.src( bundle.src) .pipe(sourcemaps.init()) .pipe(concat(bundle.dst + '.' + opts.ext)) .pipe(uglify()) .pipe(sourcemaps.write()) .pipe(gulp.dest('./public/built')); This produces appropriately concatenated and uglyified files. However there are no source map additions to them. bundle.src is an array of file paths. Not sure how to debug this. 回答1: You should look into gulp-util. It may give you

How to batch similar gulp tasks to reduce code repetition

我的未来我决定 提交于 2019-12-09 23:45:31
问题 I have written a gulp file that watches over several directories for changes, and then create concatenation to multiple specified destination. Here is a simplified version of my project structure: I have 2 site folders: one/ and two/ Each site have two branch folders: a/ and b/ Inside each branch, there are three folders: inner/ , outer/ and web/ My task is to grab similar part files from the inner and outer folders, and concatenate them into relative web folders. Below is a simple example of

Keep folder structure with concat() in gulp

痞子三分冷 提交于 2019-12-08 03:30:34
问题 Folder structure: project | +-coffee | | | +-main.coffee | | | +-testDir | | | | | +-models.coffee | | | | | +-views.coffee | | | +-anotherDir | | | | | +-routes.coffee | | | | | +-views.coffee | | | | | +-modules.coffee | | | +- etc... | +-www The idea is to keep the folder structure from the coffee/ directory when writing files to the www/ directory. There can be an arbitrary number of subfolders in coffee/ . All .coffee files from each folder should be concatened into a modules.js file:

Angular module().factory() is not a function after concat (gulp)

限于喜欢 提交于 2019-12-07 01:55:24
问题 Trying to concat/uglify my angular app using gulp for the last few hours, i have stripped down whole process to simple concat, and even removed angular file from concat process to a separate <script> request in header - and still, I receive the same error: Uncaught TypeError: angular.module(...).factory(...) is not a function Without concat everything is fine. My gulp task: gulp.task('JS', function() { gulp.src(['!_dependencies/angular.min.js', '_dependencies/jquery.min.js', '_dependencies

Gulp concat and require path

笑着哭i 提交于 2019-12-02 08:41:31
问题 I have a problem with gulp-concat. I'm trying to concate all my js files in a single file, let's say, dist/app.js. But there is something that I don't understand. In that file, my required files path are still the same than before... Here is my gulpfile.js : var gulp = require("gulp"); var sourcemaps = require("gulp-sourcemaps"); var babel = require("gulp-babel"); var concat = require("gulp-concat"); var resolveDependencies = require("gulp-resolve-dependencies"); gulp.task("default", function

Gulp concat and require path

五迷三道 提交于 2019-12-02 05:45:47
I have a problem with gulp-concat. I'm trying to concate all my js files in a single file, let's say, dist/app.js. But there is something that I don't understand. In that file, my required files path are still the same than before... Here is my gulpfile.js : var gulp = require("gulp"); var sourcemaps = require("gulp-sourcemaps"); var babel = require("gulp-babel"); var concat = require("gulp-concat"); var resolveDependencies = require("gulp-resolve-dependencies"); gulp.task("default", function () { return gulp.src("client/**/*.js") .pipe(sourcemaps.init()) .pipe(babel()) .pipe(concat("app.js"))

What is wrong with this code that combines multiple js files to one?

流过昼夜 提交于 2019-12-02 02:53:42
问题 I have this node.js code that tries to minify and combine multiple js files to a single js file. var concat = require('gulp-concat'); var gulp = require('gulp'); gulp.task('scripts', function() { //gulp.src(['./lib/file3.js', './lib/file1.js', './lib/file2.js']) gulp.src(['./js/*.js']) .pipe(concat('all.js')) .pipe(uglify()) .pipe(gulp.dest('./dist/')) }); All my js files are located in js folder. My node.js file is above the js folder. I am expecting the single minified file to appear in