How to use the @microsoft/sp-build-web.getConfig 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 / tutorials / tutorial-getting-started / documentcardexample-webpart / gulpfile.js View on Github external
additionalConfiguration: (generatedConfiguration) => {
        if (build.getConfig().production) {
            var basePath = build.writeManifests.taskConfig.cdnBasePath;
            if (!basePath.endsWith('/')) {
                basePath += '/';
            }
            generatedConfiguration.output.publicPath = basePath;
        }
        else {
            generatedConfiguration.output.publicPath = "/dist/";
        }
        return generatedConfiguration;
    }
});
github BobGerman / SPFx / Twitter / gulpfile.js View on Github external
additionalConfiguration: (generatedConfiguration) => {
        if (build.getConfig().production) {
            var basePath = build.writeManifests.taskConfig.cdnBasePath;
            if (!basePath.endsWith('/')) {
                basePath += '/';
            }
            generatedConfiguration.output.publicPath = basePath;
        }
        else {
            generatedConfiguration.output.publicPath = "/dist/";
        }
        return generatedConfiguration;
    }
});
github pnp / generator-spfx / app / templates / gulptasks / azuredevops.js View on Github external
'use strict';

const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);

build.initialize(gulp);
var buildConfig = build.getConfig();
var karmaTaskCandidates = buildConfig.uniqueTasks.filter((t) => t.name === 'karma');
if(karmaTaskCandidates && karmaTaskCandidates.length > 0) {
  var karmaTask = karmaTaskCandidates[0];
  karmaTask.taskConfig.configPath = './config/karma.config.js';
}