Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Rommy Barriga
    @RomitaDinda
    someone that could help me with gulp pls? say yes :D
    Rommy Barriga
    @RomitaDinda
    blef XD
    Claudio Semeraro
    @keepitterron

    Quick question: i use gulp with babel. Everything was working fine until i upgraded to babel 7.4
    It seems like gulp doesn't automagically require @babel/register and fails with Unexpected token import. all works fine if i manually do gulp --require @babel/register.
    Anybody can point me to the right direction?

    babel.config.js

    module.exports = {
      plugins: [
        '@babel/plugin-transform-object-assign',
        '@babel/plugin-transform-runtime',
        '@babel/plugin-transform-async-to-generator',
        '@babel/plugin-proposal-object-rest-spread',
        '@babel/plugin-proposal-class-properties',
      ],
      presets: [
        '@babel/preset-react',
        [
          '@babel/preset-env',
          {
            useBuiltIns: 'usage',
            corejs: 3,
          },
        ],
      ],
      env: {
        test: {
          plugins: ['istanbul'],
        },
      },
    };

    and the gulp config is named gulpfile.babel.js

    Claudio Semeraro
    @keepitterron
    issue here was: I had both gulpfile.js and gulpfile.babel.js in my root. For some reason upgrading babel has changed what's happening and the former was being now loaded :/
    Anthony Pipkin
    @apipkin_gitlab
    I have an issue where i am trying to create a default task and have it run. if I run the task directly everything completes. If I run the task as a series in the default task it asks me if it completed. It feels like I am missing something really simple :-/ Can anyone @here help? https://gist.github.com/apipkin/00e3bac1ecb0eec3fad39eef9373b481
    Lukas Körfer
    @lukoerfer
    Your default export is a function calling series(), but it should be the result of the series() call.
    Anthony Pipkin
    @apipkin_gitlab
    @lukoerfer Oh! Thank you so much for pointing that out. Just to be sure I understand correctly, it should be export default series(AllJS);, correct?
    Lukas Körfer
    @lukoerfer
    Yes, I guess so. I never used the ES6 module system, but series() returns a task
    hachimi ahmed amine
    @HACHIMIam
    hello guys
    i have this config
    const gulp = require('gulp');
    const paths = require('./../lib/paths');
    const gulpif = require('gulp-if');
    const changed = require('gulp-changed');
    const plumber = require('gulp-plumber');
    const sourcemaps = require('gulp-sourcemaps');
    
    gulp.task('es6', () => {
        const babel = require('gulp-babel');
        const config = require('./../lib/config');
        const babelConfiguration = require('./../configuration/babel.config');
    
        const scripts = paths.getAppPaths();
        return gulp.src([
            ...scripts.sources,
        ], { base: scripts.root })
            .pipe(gulpif(config.global.sourceMaps, sourcemaps.init()))
            .pipe(plumber())
            .pipe(changed(scripts.dist, { extension: '.js' }))
            .pipe(babel(babelConfiguration))
            .pipe(gulpif(config.global.sourceMaps, sourcemaps.write('.')))
            .pipe(gulp.dest(scripts.dist));
    });
    and this config
    const config = require('./../lib/config');
    const babelEnv = require('@babel/preset-env');
    const browsersList = require('./browserslist');
    const babelSystemJS = require('@babel/plugin-transform-modules-systemjs');
    const path = require('path');
    const { argv } = require('yargs');
    
    const babelPlugins = [];
    
    if (config.global.jspm) {
        babelPlugins.push([babelSystemJS]);
    }
    
    const presets = [
        [babelEnv, {
            // "useBuiltIns": "entry",
            // "targets": browsersList,
        }],
    ];
    
    if (argv.production) {
        presets.push(['minify', {
            builtIns: false,
            mangle: {
                keepFnName: true,
            },
        }]);
    }
    
    
    module.exports = {
        babelrc: false,
        plugins: babelPlugins,
        cwd: path.dirname(__dirname),
        presets,
        moduleIds: false,
        comments: false,
    };
    i enabled the minify presets in production only because in dev sourceMaps doesn’t work well
    hachimi ahmed amine
    @HACHIMIam
    for example in development without minify presets i have this
    Screenshot 2019-07-18 at 09.48.33.png
    and in production with minify i have this
    Screenshot 2019-07-18 at 09.21.23.png
    hachimi ahmed amine
    @HACHIMIam
    Mathieu Schimmerling
    @matschik
    Hello everybody !
    How to use "gulp.parallel" with async functions (tasks) ?
    Mathieu Schimmerling
    @matschik
    For example:
    // IT WORKS !
    exports.build = parallel(...jsBuildTasks);
    
    // NOT WORKING
    const wrap = async () => parallel(...jsBuildTasks);
    exports.build = wrap;
    Nathan Querido
    @nfquerido_gitlab
    Hey all. I'm trying to use a single gulp file for multiple projects. Wanting to do something like gulp --project projectName. I see I can use yargs. But my attempts so far aren't working.
    Here's a gist of my config file: https://gist.github.com/nfq/fbd674f4849ad9fb10e326eef3a5ca54
    I can send my Gulpfile as well if necessary.
    ray007
    @ray007
    @matschik just using parallel() with the async functions as parameters does not work?
    Mathieu Schimmerling
    @matschik
    @ray007 it works (look at the first 2 lines) but just if i don't return it with a function (in this example: wrap). It works only if I export it immediately like the first 2 lines.
    Mathieu Schimmerling
    @matschik
    @nfquerido_gitlab show me your gulp file
    hachimi ahmed amine
    @HACHIMIam
    @matschik can you help me please
    Mathieu Schimmerling
    @matschik
    @HACHIMIam babel-minify is an experimental project so there are bugs obviously. babel minify is maybe not what you want.
    To minify your JS code, use the most popular js minifier: https://github.com/mishoo/UglifyJS2
    @HACHIMIam You may use https://github.com/terinjokes/gulp-uglify for gulp
    @HACHIMIam And the problem is not from gulp, it's about your babl-minify. So please avoid to use this channel ^^'
    hachimi ahmed amine
    @HACHIMIam
    aah ok thank you so much
    i will switch to gulp-uglify
    Nathan Querido
    @nfquerido_gitlab
    @matschik thanks for asking.. But I figured it out. I'm doing this now:
    if (argv.project) {
        let settings = Object.assign(paths, paths.default, paths[argv.project]);
    }
    Mathieu Schimmerling
    @matschik
    @nfquerido_gitlab Perfect ;)
    hachimi ahmed amine
    @HACHIMIam
    @matschik i switch to gulp-uglify and i still have the same issue
    hachimi ahmed amine
    @HACHIMIam
    i have the same issue with gulp-uglify now @matschik
    Andi Chou
    @andichou

    Hi folks,

    anyone have an experience on this issue?

    [16:42:22] Starting 'ngc'...
    : Error: FileSystem has not been configured. Please call `setFileSystem()` before calling this method.
    environment:
    gulp 4.0.2
    angular-compiler-cli: 8.1.2
    Vincenzo Palazzo
    @vincenzopalazzo

    Hi, guys, I'm new in the javascript world and now I'm using the gulp for running my simple app with node js and using gulp-nodemon for operation with the server, now I have run the app with gulp but how stop the app with gulp?

    this is my code

    var gulp = require('gulp');
    var nodemon = require('gulp-nodemon');
    
    var nameFileServer = 'server.js';
    
    // start our server and listen for changes
    gulp.task('server', function() {
        // configure nodemon
        nodemon({
            // the script to run the app
            script: nameFileServer,
            // this listens to changes in any of these files/routes and restarts the application
            watch: [nameFileServer, './model/*.js'],
            ext: 'js'
            // Below i'm using es6 arrow functions but you can remove the arrow and have it a normal .on('restart', function() { // then place your stuff in here }
        }).on('restart', () => {
            gulp.src(nameFileServer)
            // I've added notify, which displays a message on restart. Was more for me to test so you can remove this
                .pipe(notify('Running the start tasks and stuff'));
        });
    });
    arjanjenny
    @arjanjenny
    hi guys
    Liliyan Krumov
    @rafatpc
    Hi! Anyone ever got "No element indexed by 0" error when trying to make source maps?
    Liliyan Krumov
    @rafatpc
    Files was missing. Commenting out the exception throw have shown the missing file. Hope it helps someone!
    Cecilia
    @merapelsin_gitlab
    Hello peeps
    Cecilia
    @merapelsin_gitlab

    What's the correct way to do multiple 'tasks' within a function(task)? Let's say I want to compile coffeescript into javascript and have multiple files that's has to be done on their own. This means I can't do the return thing for example:

    function jsTask(){
        return src([files.jsPath])
            .pipe(concat('all.js'))
            .pipe(uglify())
            .pipe(dest('dist')
        );
    }

    Since that'd only return the first "batch" and nothing after. But I don't want like 5 different functions that all compiles coffee into js. So whats a good way to tackle this? Thanks!

    Mark Carpenter Jr
    @mcarpenterjr
    You can do something like js/**/* and direct the pipe to consume everythig in that directory.
    and if I remember correctly something like js/**/*.js should consume only js files.
    Here is an example snippet from an old gulp file that copies everything to a preview folder and runs it through a sed tool that appends a rev number on all the URI's of resources to bust cache.
    gulp.task('user-preview', ['clean-preview'], function() {
      console.log(chalk.red.bold('Creating Preview Directory'));
      gulp.src('./_src/**/*.*')
      .pipe(rev())
      .pipe(gulp.dest('./_preview'));
    });
    Cecilia
    @merapelsin_gitlab
    Thanks~