Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. // @ts-check
  2. 'use strict';
  3. const gulp = require('gulp');
  4. const build = require("@microsoft/sp-build-web");
  5.  
  6. build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
  7.  
  8. // Retrieve the current build config and check if there is a `warnoff` flag set
  9. const crntConfig = build.getConfig();
  10. const warningLevel = crntConfig.args["warnoff"];
  11.  
  12. // Extend the SPFx build rig, and overwrite the `shouldWarningsFailBuild` property
  13. if (warningLevel) {
  14. class CustomSPWebBuildRig extends build.SPWebBuildRig {
  15. setupSharedConfig() {
  16. build.log("IMPORTANT: Warnings will not fail the build.")
  17. build.mergeConfig({
  18. shouldWarningsFailBuild: false
  19. });
  20. super.setupSharedConfig();
  21. }
  22. }
  23.  
  24. build.rig = new CustomSPWebBuildRig();
  25. }
  26.  
  27. build.initialize(gulp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement