How to use the @microsoft/web-library-build.getConfig function in @microsoft/web-library-build

To help you get started, we’ve selected a few @microsoft/web-library-build 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 microsoft / rushstack / build-tests / web-library-build-test / karma.config.js View on Github external
'use strict';

// Karma configuration
// Generated on Thu Oct 08 2015 18:13:05 GMT-0700 (PDT)

let path = require('path');
let build = require('@microsoft/web-library-build');
let configResources = build.karma.resources;

let bindPolyfillPath = configResources.bindPolyfillPath;
let debugRun = (process.argv.indexOf('--debug') > -1);

let testsFilePath = path.join(build.getConfig().tempFolder, 'tests.js');

module.exports = function(config) {
  let karmaConfig = {

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '.',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'sinon-chai'],


    // list of files / patterns to load in the browser
    files: [bindPolyfillPath].concat([testsFilePath]),
github OfficeDev / office-ui-fabric-react / apps / fabric-examples / gulpfile.js View on Github external
function startRun() {
    if (!isBuilding) {
      isBuilding = true;
      buildEnqueued = false;

      console.log('Starting build...');

      rushBuild.execute(build.getConfig()).then(() => {
        isBuilding = false;

        // After build is complete, trigger reload.
        build.reload.execute(build.getConfig());

        if (buildEnqueued) {
          startRun();
        }
      }).catch(() => {
        isBuilding = false;
        if (buildEnqueued) {
          startRun();
        }
      });
    } else {
      buildEnqueued = true;
github OfficeDev / office-ui-fabric-react / apps / fabric-examples / webpack.config.js View on Github external
'use strict';

/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let buildConfig = build.getConfig();
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let SplitByPathPlugin = require('webpack-split-by-path');
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const IS_PRODUCTION = process.argv.indexOf('--production') >= 0;
const BUNDLE_NAME = 'fabric-examples';

// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
  createConfig(IS_PRODUCTION)
];

// Helper to create the config.
function createConfig(isProduction) {
github OfficeDev / office-ui-fabric-react / webpack.lib.config.js View on Github external
'use strict';

/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let VisualizerPlugin = require('webpack-visualizer-plugin');
let buildConfig = build.getConfig();

// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
  createConfig(false)
];

// Create a production config if applicable.
if (process.argv.indexOf('--production') > -1) {
  configs.push(createConfig(true));
}

// Helper to create the config.
function createConfig(isProduction) {
  let webpackConfig = {
    context: buildConfig.libFolder,
github OfficeDev / office-ui-fabric-react / packages / office-ui-fabric-react / webpack.lib.config.js View on Github external
'use strict';

/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let buildConfig = build.getConfig();
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const BUNDLE_NAME = 'office-ui-fabric-react';
const BUNDLE_TEST = 'fabric-test';
const IS_PRODUCTION = process.argv.indexOf('--production') > -1;

// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
  createConfig(false)
];

// Create a production config if applicable.
if (IS_PRODUCTION) {
  configs.push(createConfig(true));
}
github OfficeDev / office-ui-fabric-react / packages / experiments / webpack.lib.config.js View on Github external
'use strict';

/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;
let path = require('path');
let buildConfig = build.getConfig();
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const BUNDLE_NAME = 'experiments';
const BUNDLE_TEST = 'fabric-test';
const IS_PRODUCTION = process.argv.indexOf('--production') > -1;

// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
  createConfig(false)
];

// Create a production config if applicable.
if (IS_PRODUCTION) {
  configs.push(createConfig(true));
}
github OfficeDev / office-ui-fabric-react / apps / fabric-website / gulpfile.js View on Github external
'use strict';

let build = require('@microsoft/web-library-build');
let gulp = require('gulp');
let buildConfig = build.getConfig();
let distFolder = buildConfig.distFolder;
let path = require('path');
let packageFolder = buildConfig.packageFolder || '';
let isProduction = process.argv.indexOf('--production') >= 0;
let isNuke = process.argv.indexOf('nuke') >= 0;

// Use css modules and use export =
build.sass.setConfig({
  useCSSModules: true,
  moduleExportName: ''
});

// Configure custom lint overrides.
let rules = Object.assign(
  {},
  require('./node_modules/@microsoft/gulp-core-build-typescript/lib/defaultTslint.json').rules,
github OfficeDev / office-ui-fabric-react / apps / fabric-examples / gulpfile.js View on Github external
'use strict';

let build = require('@microsoft/web-library-build');
let serial = build.serial;
let buildConfig = build.getConfig();
let gulp = require('gulp');
let configFile = "./ftpconfig.json";
let fs = require('fs');
let path = require('path');
let pkg = require('./package.json');
let isProduction = process.argv.indexOf('--production') >= 0;
let isNuke = process.argv.indexOf('nuke') >= 0;

// Configur custom lint rules.
let rules = Object.assign(
  {},
  require('./node_modules/@microsoft/gulp-core-build-typescript/lib/defaultTslint.json').rules,
  require('../../tslint.json').rules,
  require('./tslint.json').rules
);
build.tslint.setConfig({ lintConfig: { rules } });
github microsoft / rushstack / core-build / gulp-core-build-karma / karma.config.js View on Github external
'use strict';

// Karma configuration
// Generated on Thu Oct 08 2015 18:13:05 GMT-0700 (PDT)

let path = require('path');
let build = require('@microsoft/web-library-build');
let configResources = build.karma.resources;

let bindPolyfillPath = configResources.bindPolyfillPath;
let debugRun = (process.argv.indexOf('--debug') > -1);

let testsFilePath = path.join(build.getConfig().tempFolder, 'tests.js');

module.exports = function(config) {
  let karmaConfig = {

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '.',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'sinon-chai'],


    // list of files / patterns to load in the browser
    files: [bindPolyfillPath].concat([testsFilePath]),
github OfficeDev / office-ui-fabric-react / webpack.demo.config.js View on Github external
'use strict';

/** Note: this require may need to be fixed to point to the build that exports the gulp-core-build-webpack instance. */
let build = require('@microsoft/web-library-build');
let buildConfig = build.getConfig();
let webpackTaskResources = build.webpack.resources;
let webpack = webpackTaskResources.webpack;

let path = require('path');
var SplitByPathPlugin = require('webpack-split-by-path');

// Create an array of configs, prepopulated with a debug (non-minified) build.
let configs = [
  createConfig(false)
];

// Create a production config if applicable.
if (process.argv.indexOf('--production') > -1) {
  configs.push(createConfig(true));
}