3

We have created an SPFx webpart solution and it contains 5 web parts in it. 3 out of 5 web parts are related to one client and rest 2 web parts are related to another client. now I want to deploy this solution in two packages.

first package with first 3 web parts,

second package with last 2 web parts.

Both the client should not be able to see web parts which are not related to them.

Please let me know whether this is possible or not. If possible then how to achieve this.

2 Answers 2

0

You can probably do this by creating a Gulp task. However I would advise against it, since it would be time consuming and messy maintenance wise.

If you do wish to proceed, have a look at your gulpfile.js. This is how you can add a custom task:

'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');

// Defining a custom task:
gulp.task('mytask', function() {
    console.log('My custom task is running.');
});

build.initialize(gulp);
2
  • Hi thanks for the reply, but I am excepting something like features in SharePoint server farm solution. Where you can add and remove web parts or components (by moving from left side to right or right to left respectively in the feature window). but SPFX does not have this kind of granular feature. if they build the solution based on some configuration like this then it will be helpfull. Commented Nov 23, 2017 at 5:10
  • @Papageno How to separate the custom task to separate file?
    – Arun
    Commented Jan 17, 2021 at 21:35
0

Your question is somehow related to what I am trying to achieve, hence I am linking it to yours.

automate spfx packaging including selected components

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.