-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
28 lines (24 loc) · 919 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
const merge = require('webpack-merge');
const TerserPlugin = require('terser-webpack-plugin-legacy');
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Pivot' is not camelCase and will not be type-safe.`);
build.configureWebpack.setConfig({
additionalConfiguration: function (config) {
let newConfig = config;
config.plugins.forEach((plugin, i) => {
if (plugin.options && plugin.options.mangle) {
config.plugins.splice(i, 1);
newConfig = merge(config, {
plugins: [
new TerserPlugin()
]
});
}
});
return newConfig;
}
});
build.initialize(gulp);