-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
35 lines (25 loc) · 916 Bytes
/
gulpfile.js
File metadata and controls
35 lines (25 loc) · 916 Bytes
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
'use strict';
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.`);
//add start from https://n8d.at/how-to-bundle-and-use-custom-web-fonts-in-spfx-projects
// Font loader configuration for webfonts
const fontLoaderConfig = {
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
//name: '[name].[ext]',
name: '[name]_[sha1:hash:hex:8].[ext]',
outputPath: 'fonts/'
}
}]
};
// Merge custom loader to web pack configuration
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
generatedConfiguration.module.rules.push(fontLoaderConfig);
return generatedConfiguration;
}
});
//add end
build.initialize(require('gulp'));