How to use the @microsoft/sp-build-web.rig function in @microsoft/sp-build-web

To help you get started, we’ve selected a few @microsoft/sp-build-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SharePoint / sp-dev-fx-webparts / samples / react-mytasks / gulpfile.js View on Github external
console.log('[stylelint]: By default style lint errors will not break your build. If you want to change this behaviour, modify failAfterError parameter in gulpfile.js.');

    return gulp
        .src('src/**/*.scss')
        .pipe(stylelint({
            failAfterError: false,
            reporters: [{
                formatter: 'string',
                console: true
            }]
        }));
});
/* end sub task */

build.rig.addPreBuildTask(styleLintSubTask);

/**
 * Custom Framework Specific gulp tasks
 */


build.initialize(gulp);
github SharePoint / sp-dev-fx-extensions / samples / js-application-run-once / gulpfile-serve-info.js View on Github external
'use strict';

const build = require('@microsoft/sp-build-web');
const common = require("@microsoft/sp-build-common");

const originalBundleTask = build.rig.getBundleTask;
build.rig.getBundleTask = function () {
    const originalTask = originalBundleTask.apply(build.rig);
    return common.serial(originalTask, serveInfo);
}

const serveInfo = build.subTask('serve-info', (gulp, config, cb) => {
    var serveTask = config.uniqueTasks.find((task) => {
        return task.name === 'serve' /* SPFx < 1.2.0 */ ||
            task.name === 'spfx-serve' /* SPFx >= 1.2.0 */ ;
    });
    var url = `http${serveTask.taskConfig.https ? 's' : ''}://${serveTask.taskConfig.hostname}:${serveTask.taskConfig.port}/temp/manifests.js`;
    for (var key in config.properties.manifests) {
        var manifest = config.properties.manifests[key];
        if (manifest.componentType !== 'Extension') {
            continue;
        }
github SharePoint / sp-dev-build-extensions / tools / gulp-tasks / serve-info / gulpfile-serve-info.js View on Github external
'use strict';

const build = require('@microsoft/sp-build-web');
const common = require("@microsoft/sp-build-common");

const originalBundleTask = build.rig.getBundleTask;
build.rig.getBundleTask = function () {
    const originalTask = originalBundleTask.apply(build.rig);
    return common.serial(originalTask, serveInfo);
}

const serveInfo = build.subTask('serve-info', (gulp, config, cb) => {
    var serveTask = config.uniqueTasks.find((task) => {
        return task.name === 'serve' /* SPFx < 1.2.0 */ ||
            task.name === 'spfx-serve' /* SPFx >= 1.2.0 */ ;
    });
    var url = `http${serveTask.taskConfig.https ? 's' : ''}://${serveTask.taskConfig.hostname}:${serveTask.taskConfig.port}/temp/manifests.js`;
    for (var key in config.properties.manifests) {
        var manifest = config.properties.manifests[key];
        if (manifest.componentType !== 'Extension') {
            continue;
        }
github SharePoint / sp-dev-fx-extensions / samples / js-application-run-once / gulpfile-serve-info.js View on Github external
'use strict';

const build = require('@microsoft/sp-build-web');
const common = require("@microsoft/sp-build-common");

const originalBundleTask = build.rig.getBundleTask;
build.rig.getBundleTask = function () {
    const originalTask = originalBundleTask.apply(build.rig);
    return common.serial(originalTask, serveInfo);
}

const serveInfo = build.subTask('serve-info', (gulp, config, cb) => {
    var serveTask = config.uniqueTasks.find((task) => {
        return task.name === 'serve' /* SPFx < 1.2.0 */ ||
            task.name === 'spfx-serve' /* SPFx >= 1.2.0 */ ;
    });
    var url = `http${serveTask.taskConfig.https ? 's' : ''}://${serveTask.taskConfig.hostname}:${serveTask.taskConfig.port}/temp/manifests.js`;
    for (var key in config.properties.manifests) {
        var manifest = config.properties.manifests[key];
        if (manifest.componentType !== 'Extension') {
            continue;
        }
github SharePoint / sp-dev-build-extensions / tools / gulp-tasks / serve-info / gulpfile-serve-info.js View on Github external
'use strict';

const build = require('@microsoft/sp-build-web');
const common = require("@microsoft/sp-build-common");

const originalBundleTask = build.rig.getBundleTask;
build.rig.getBundleTask = function () {
    const originalTask = originalBundleTask.apply(build.rig);
    return common.serial(originalTask, serveInfo);
}

const serveInfo = build.subTask('serve-info', (gulp, config, cb) => {
    var serveTask = config.uniqueTasks.find((task) => {
        return task.name === 'serve' /* SPFx < 1.2.0 */ ||
            task.name === 'spfx-serve' /* SPFx >= 1.2.0 */ ;
    });
    var url = `http${serveTask.taskConfig.https ? 's' : ''}://${serveTask.taskConfig.hostname}:${serveTask.taskConfig.port}/temp/manifests.js`;
    for (var key in config.properties.manifests) {
        var manifest = config.properties.manifests[key];
        if (manifest.componentType !== 'Extension') {
            continue;
        }
github Puzzlepart / spfx-solutions / Pzl.Ext.PDFExport / gulpfile.js View on Github external
'use strict';

const gulp = require('gulp');
const path = require('path');
const build = require('@microsoft/sp-build-web');

let copyIcons = build.subTask('copy-icons', function (gulp, buildOptions, done) {
    gulp.src('./*.svg')
        .pipe(gulp.dest('./temp/deploy'));
    done();
});
build.rig.addPostBuildTask(copyIcons);

const bundleAnalyzer = require('webpack-bundle-analyzer');

build.configureWebpack.mergeConfig({
  additionalConfiguration: (generatedConfiguration) => {
    const lastDirName = path.basename(__dirname);
    const dropPath = path.join(__dirname, 'temp', 'stats');
    generatedConfiguration.plugins.push(new bundleAnalyzer.BundleAnalyzerPlugin({
      openAnalyzer: false,
      analyzerMode: 'static',
      reportFilename: path.join(dropPath, `${lastDirName}.stats.html`),
      generateStatsFile: true,
      statsFilename: path.join(dropPath, `${lastDirName}.stats.json`),
      logLevel: 'error'
    }));
github SharePoint / sp-dev-fx-webparts / samples / vuejs-todo-single-file-component / gulpfile.js View on Github external
}
                            }]
                    }]
            },
        };

        return merge(config, vueConfig);
    }
});

let copyOtherFiles = build.subTask('copy-other-files', function(gulp, buildOptions, done){
    return gulp.src(['src/**/*.vue', 'src/**/*.scss'])
               .pipe(gulp.dest(buildOptions.libFolder))
});
build.task('copy-other-files', copyOtherFiles);
build.rig.addPostTypescriptTask(copyOtherFiles);

build.initialize(gulp);
github SharePoint / sp-dev-build-extensions / tools / gulp-tasks / serve-info / gulpfile-serve-info.js View on Github external
build.rig.getBundleTask = function () {
    const originalTask = originalBundleTask.apply(build.rig);
    return common.serial(originalTask, serveInfo);
}
github SharePoint / sp-dev-fx-extensions / samples / js-application-run-once / gulpfile-serve-info.js View on Github external
build.rig.getBundleTask = function () {
    const originalTask = originalBundleTask.apply(build.rig);
    return common.serial(originalTask, serveInfo);
}