How to use @microsoft/web-library-build - 10 common examples

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'],
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 / gulpfile.js View on Github external
const sourceMatch = [];

projectMatch.forEach(project => sourceMatch.push(
  `${project}/src/**/*.{ts,tsx,scss,js,txt,html}`,
  `!${project}/src/**/*.scss.ts`
));

let rushBuild = build.subTask('rushBuild', (gulp, options, done) => {
  let child = exec(`rush build --to ${pkg.name} ${isProduction ? '--production' : ''}`);

  child.stdout.on('data', data => process.stdout.write(data));
  child.on('close', done);
});

let customWatch = build.subTask('customWatch', (gulp, options, done) => {
  let gaze = require('gaze');
  let isBuilding = false;
  let buildEnqueued = false;

  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());
github OfficeDev / office-ui-fabric-react / apps / fabric-examples / gulpfile.js View on Github external
}
  };

  // Start watch at root of repo.
  let rootPath = path.resolve(__dirname, '../..');
  console.log(`Starting watch in ${rootPath}`);
  gaze(sourceMatch, { cwd: rootPath }, function () {
    this.on('all', startRun);
  });
});

build.task('w', customWatch);

build.task('serve', serial(
  rushBuild,
  build.serve,
  customWatch
));

// Shortcuts for individual subtasks.
build.task('webpack', build.webpack);
build.task('tslint', build.tslint);
build.task('ts', build.typescript);

// initialize tasks.
build.initialize(gulp);
github OfficeDev / office-ui-fabric-react / packages / utilities / gulpfile.js View on Github external
'use strict';

let gulp = require('gulp');
let build = require('@microsoft/web-library-build');

build.task('sass', build.sass);
build.task('karma', build.karma);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});

// Use css modules.
build.sass.setConfig({
  useCSSModules: true
});
github OfficeDev / office-ui-fabric-react / apps / fabric-examples / gulpfile.js View on Github external
this.on('all', startRun);
  });
});

build.task('w', customWatch);

build.task('serve', serial(
  rushBuild,
  build.serve,
  customWatch
));

// Shortcuts for individual subtasks.
build.task('webpack', build.webpack);
build.task('tslint', build.tslint);
build.task('ts', build.typescript);

// initialize tasks.
build.initialize(gulp);
github OfficeDev / office-ui-fabric-react / packages / utilities / gulpfile.js View on Github external
'use strict';

let gulp = require('gulp');
let build = require('@microsoft/web-library-build');

build.task('sass', build.sass);
build.task('karma', build.karma);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});

// Use css modules.
build.sass.setConfig({
  useCSSModules: true
});
github OfficeDev / office-ui-fabric-react / packages / styling / gulpfile.js View on Github external
'use strict';

let gulp = require('gulp');
let build = require('@microsoft/web-library-build');

build.task('sass', build.sass);
build.task('karma', build.karma);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});

// Use css modules.
build.sass.setConfig({
  useCSSModules: true,
  moduleExportName: ''
});
github OfficeDev / office-ui-fabric-react / packages / styling / gulpfile.js View on Github external
'use strict';

let gulp = require('gulp');
let build = require('@microsoft/web-library-build');

build.task('sass', build.sass);
build.task('karma', build.karma);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});

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