Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log('[stylelint]: By default style lint errors will not break your build. If you want to change this behaviour, modify failAfterError parameter in gulpfile.js.');
return gulp
.src('src/**/*.scss')
.pipe(stylelint({
failAfterError: false,
reporters: [{
formatter: 'string',
console: true
}]
}));
});
/* end sub task */
build.rig.addPreBuildTask(styleLintSubTask);
/**
* Custom Framework Specific gulp tasks
*/
build.initialize(gulp);
'use strict';
const build = require('@microsoft/sp-build-web');
const common = require("@microsoft/sp-build-common");
const originalBundleTask = build.rig.getBundleTask;
build.rig.getBundleTask = function () {
const originalTask = originalBundleTask.apply(build.rig);
return common.serial(originalTask, serveInfo);
}
const serveInfo = build.subTask('serve-info', (gulp, config, cb) => {
var serveTask = config.uniqueTasks.find((task) => {
return task.name === 'serve' /* SPFx < 1.2.0 */ ||
task.name === 'spfx-serve' /* SPFx >= 1.2.0 */ ;
});
var url = `http${serveTask.taskConfig.https ? 's' : ''}://${serveTask.taskConfig.hostname}:${serveTask.taskConfig.port}/temp/manifests.js`;
for (var key in config.properties.manifests) {
var manifest = config.properties.manifests[key];
if (manifest.componentType !== 'Extension') {
continue;
}
'use strict';
const build = require('@microsoft/sp-build-web');
const common = require("@microsoft/sp-build-common");
const originalBundleTask = build.rig.getBundleTask;
build.rig.getBundleTask = function () {
const originalTask = originalBundleTask.apply(build.rig);
return common.serial(originalTask, serveInfo);
}
const serveInfo = build.subTask('serve-info', (gulp, config, cb) => {
var serveTask = config.uniqueTasks.find((task) => {
return task.name === 'serve' /* SPFx < 1.2.0 */ ||
task.name === 'spfx-serve' /* SPFx >= 1.2.0 */ ;
});
var url = `http${serveTask.taskConfig.https ? 's' : ''}://${serveTask.taskConfig.hostname}:${serveTask.taskConfig.port}/temp/manifests.js`;
for (var key in config.properties.manifests) {
var manifest = config.properties.manifests[key];
if (manifest.componentType !== 'Extension') {
continue;
}
'use strict';
const build = require('@microsoft/sp-build-web');
const common = require("@microsoft/sp-build-common");
const originalBundleTask = build.rig.getBundleTask;
build.rig.getBundleTask = function () {
const originalTask = originalBundleTask.apply(build.rig);
return common.serial(originalTask, serveInfo);
}
const serveInfo = build.subTask('serve-info', (gulp, config, cb) => {
var serveTask = config.uniqueTasks.find((task) => {
return task.name === 'serve' /* SPFx < 1.2.0 */ ||
task.name === 'spfx-serve' /* SPFx >= 1.2.0 */ ;
});
var url = `http${serveTask.taskConfig.https ? 's' : ''}://${serveTask.taskConfig.hostname}:${serveTask.taskConfig.port}/temp/manifests.js`;
for (var key in config.properties.manifests) {
var manifest = config.properties.manifests[key];
if (manifest.componentType !== 'Extension') {
continue;
}
'use strict';
const build = require('@microsoft/sp-build-web');
const common = require("@microsoft/sp-build-common");
const originalBundleTask = build.rig.getBundleTask;
build.rig.getBundleTask = function () {
const originalTask = originalBundleTask.apply(build.rig);
return common.serial(originalTask, serveInfo);
}
const serveInfo = build.subTask('serve-info', (gulp, config, cb) => {
var serveTask = config.uniqueTasks.find((task) => {
return task.name === 'serve' /* SPFx < 1.2.0 */ ||
task.name === 'spfx-serve' /* SPFx >= 1.2.0 */ ;
});
var url = `http${serveTask.taskConfig.https ? 's' : ''}://${serveTask.taskConfig.hostname}:${serveTask.taskConfig.port}/temp/manifests.js`;
for (var key in config.properties.manifests) {
var manifest = config.properties.manifests[key];
if (manifest.componentType !== 'Extension') {
continue;
}
'use strict';
const gulp = require('gulp');
const path = require('path');
const build = require('@microsoft/sp-build-web');
let copyIcons = build.subTask('copy-icons', function (gulp, buildOptions, done) {
gulp.src('./*.svg')
.pipe(gulp.dest('./temp/deploy'));
done();
});
build.rig.addPostBuildTask(copyIcons);
const bundleAnalyzer = require('webpack-bundle-analyzer');
build.configureWebpack.mergeConfig({
additionalConfiguration: (generatedConfiguration) => {
const lastDirName = path.basename(__dirname);
const dropPath = path.join(__dirname, 'temp', 'stats');
generatedConfiguration.plugins.push(new bundleAnalyzer.BundleAnalyzerPlugin({
openAnalyzer: false,
analyzerMode: 'static',
reportFilename: path.join(dropPath, `${lastDirName}.stats.html`),
generateStatsFile: true,
statsFilename: path.join(dropPath, `${lastDirName}.stats.json`),
logLevel: 'error'
}));
}
}]
}]
},
};
return merge(config, vueConfig);
}
});
let copyOtherFiles = build.subTask('copy-other-files', function(gulp, buildOptions, done){
return gulp.src(['src/**/*.vue', 'src/**/*.scss'])
.pipe(gulp.dest(buildOptions.libFolder))
});
build.task('copy-other-files', copyOtherFiles);
build.rig.addPostTypescriptTask(copyOtherFiles);
build.initialize(gulp);
build.rig.getBundleTask = function () {
const originalTask = originalBundleTask.apply(build.rig);
return common.serial(originalTask, serveInfo);
}
build.rig.getBundleTask = function () {
const originalTask = originalBundleTask.apply(build.rig);
return common.serial(originalTask, serveInfo);
}