Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const build = require('@microsoft/sp-build-web');
const sppkgDeploy = require('node-sppkg-deploy');
const environmentInfo = {
"username": "",
"password": "",
"tenant": "",
"catalogSite": ""
};
build.task('deploy-sppkg', {
execute: (config) => {
environmentInfo.username = config.args['username'] || environmentInfo.username;
environmentInfo.password = config.args['password'] || environmentInfo.password;
environmentInfo.tenant = config.args['tenant'] || environmentInfo.tenant;
environmentInfo.catalogSite = config.args['catalogsite'] || environmentInfo.catalogSite;
const pkgFile = require('./config/package-solution.json');
if (pkgFile) {
// Retrieve the filename from the package solution config file
let filename = pkgFile.paths.zippedPackage;
// Remove the solution path from the filename
filename = filename.split('/').pop();
// Retrieve the skip feature deployment setting from the package solution config file
const skipFeatureDeployment = pkgFile.solution.skipFeatureDeployment ? pkgFile.solution.skipFeatureDeployment : false;
// Deploy the SharePoint package
return sppkgDeploy.deploy({
'use strict';
const build = require('@microsoft/sp-build-web');
build.task('serve-info', {
execute: (config) => {
return new Promise((resolve, reject) => {
var serveTask = config.uniqueTasks.find((task) => {
return task.name === 'serve';
});
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;
}
console.log(`${manifest.alias}:`);
console.log();
console.log(`Copy the querystring parameters on the next line.`);
esModule: true
}
}]
}]
},
};
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);
'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
const spsync = require('gulp-spsync-creds').sync;
const environmentInfo = {
"username": "",
"password": "",
"tenant": "",
"cdnSite": "",
"cdnLib": ""
}
build.task('upload-to-sharepoint', {
execute: (config) => {
environmentInfo.username = config.args['username'] || environmentInfo.username;
environmentInfo.password = config.args['password'] || environmentInfo.password;
environmentInfo.tenant = config.args['tenant'] || environmentInfo.tenant;
environmentInfo.cdnSite = config.args['cdnsite'] || environmentInfo.cdnSite;
environmentInfo.cdnLib = config.args['cdnlib'] || environmentInfo.cdnLib;
return new Promise((resolve, reject) => {
const deployFolder = require('./config/copy-assets.json');
const folderLocation = `./${deployFolder.deployCdnPath}/**/*.*`;
return gulp.src(folderLocation)
.pipe(spsync({
"username": environmentInfo.username,
"password": environmentInfo.password,
"site": `https://${environmentInfo.tenant}.sharepoint.com/${environmentInfo.cdnSite}`,
'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
const spsync = require('gulp-spsync-creds').sync;
const environmentInfo = {
"username": "",
"password": "",
"tenant": "",
"catalogSite": ""
}
build.task('upload-app-pkg', {
execute: (config) => {
environmentInfo.username = config.args['username'] || environmentInfo.username;
environmentInfo.password = config.args['password'] || environmentInfo.password;
environmentInfo.tenant = config.args['tenant'] || environmentInfo.tenant;
environmentInfo.catalogSite = config.args['catalogsite'] || environmentInfo.catalogSite;
return new Promise((resolve, reject) => {
const pkgFile = require('./config/package-solution.json');
const folderLocation = `./sharepoint/${pkgFile.paths.zippedPackage}`;
return gulp.src(folderLocation)
.pipe(spsync({
"username": environmentInfo.username,
"password": environmentInfo.password,
"site": `https://${environmentInfo.tenant}.sharepoint.com/${environmentInfo.catalogSite}`,
"libraryPath": "AppCatalog",
'use strict';
const build = require('@microsoft/sp-build-web');
const fs = require('fs');
build.task('update-manifest', {
execute: (config) => {
return new Promise((resolve, reject) => {
const cdnPath = config.args['cdnpath'] || "";
let json = JSON.parse(fs.readFileSync('./config/write-manifests.json'));
json.cdnBasePath = cdnPath;
fs.writeFileSync('./config/write-manifests.json', JSON.stringify(json));
resolve();
});
}
});