-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
81 lines (58 loc) · 3.35 KB
/
gulpfile.js
File metadata and controls
81 lines (58 loc) · 3.35 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
'use strict';
//const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
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 'play-button' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'close-video' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'video-wrapper' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'image-gallery' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'app-sandbox' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'app-sandbox-content' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'app-buttons' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'app-header' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'app-interval-input-group' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'app-interval-label' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'app-interval-input' is not camelCase and will not be type-safe.`);
build.addSuppression(`Warning - [sass] The local CSS class 'app-checkboxes' is not camelCase and will not be type-safe.`);
// Font loader configuration for webfonts
const fontLoaderConfig = {
test: /\.(woff(2)?|ttf|eot|svg|otf)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}]
};
// Merge custom loader to web pack configuration
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
generatedConfiguration.module.rules.push(fontLoaderConfig);
return generatedConfiguration;
}
});
build.initialize(require('gulp'));
// gulp.task('version-sync', function () {
// // import gulp utilits to write error messages
// const gutil = require('gulp-util');
// // import file system utilities form nodeJS
// const fs = require('fs');
// // read package.json
// var pkgConfig = require('./package.json');
// // read configuration of web part solution file
// var pkgSolution = require('./config/package-solution.json');
// // log old version
// gutil.log('Old Version:\t' + pkgSolution.solution.version);
// // Generate new MS compliant version number
// var newVersionNumber = pkgConfig.version.split('-')[0] + '.0';
// // assign newly generated version number to web part version
// pkgSolution.solution.version = newVersionNumber;
// // log new version
// gutil.log('New Version:\t' + pkgSolution.solution.version);
// // write changed package-solution file
// //fs.writeFile('./config/package-solution.json', JSON.stringify(pkgSolution, null, 4));
// fs.writeFile('./config/package-solution.json', JSON.stringify(pkgSolution, null, 4), function(err, result) {
// if (err) console.log('error', err);
// });
// });