How to use the @microsoft/web-library-build.postCopy 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 OfficeDev / office-ui-fabric-react / apps / fabric-examples / gulpfile.js View on Github external
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 } });

// Configure TypeScript 2.0.
build.typescript.setConfig({ typescript: require('typescript') });

// Disable karma unit tests.
build.karma.isEnabled = () => false;

let packageFolder = buildConfig.packageFolder || '';
let distFolder = buildConfig.distFolder;

build.postCopy.setConfig({
  copyTo: {
    [distFolder]: [
      'src/**/*.png',
      'node_modules/react/dist/react.js',
      'node_modules/react-dom/dist/react-dom.js'
    ]
  }
});

// process *.Example.tsx as text for examples.
build.text.setConfig({ textMatch: ['src/**/*.Example.tsx'] });

/* Define deploy subtask */
gulp.task('install-deploy', function (cb) {
  let prompt = require('gulp-prompt');
github OfficeDev / office-ui-fabric-react / apps / fabric-website / gulpfile.js View on Github external
});

// Use Karma Tests - Disable during develoment if prefered
build.karma.isEnabled = () => false;

// Disable unnecessary subtasks.
build.preCopy.isEnabled = () => false;

// Disable tslint
build.tslint.isEnabled = () => false;

// Only run bundling in production builds; this speeds up normal ci builds.
build.webpack.isEnabled = () => isProduction;

// Copy fabric-core to dist to be published with fabric-react.
build.postCopy.setConfig({
  shouldFlatten: false,
  copyTo: {
    [path.join(distFolder, 'sass')]: [
      'node_modules/office-ui-fabric-core/dist/sass/**/*.*'
    ],
    [path.join(distFolder, 'css')]: [
      'node_modules/office-ui-fabric-core/dist/css/**/*.*'
    ]
  }
});

// Produce AMD bits in lib-amd on production builds.
if (isProduction || isNuke) {
  build.setConfig({
    libAMDFolder: path.join(packageFolder, 'lib-amd')
  });