-
Notifications
You must be signed in to change notification settings - Fork 6
Tasks
gulp --tasks
βββ config
βββ pull
βββ push
βββ live-reload
βββ masterpage
βββ custom-actions
βββ build
βββ watch
βββ live
βββ clean
βββ analyze
βββ features:disable-mds
gulp config
Inits SharePoint credentials prompt wizard.
Wizard is implemented using node-sp-auth-config library.
After config is done, auth settings are dumped to './config/private.json'.
The second run of the task checks './config/private.json' and do not prompt if it exists and all parameters for a specific are auth strategy are provided.
To force prompts dialog use:
gulp config --init
gulp pull
Initiates download of all remote assets from spFolder
to ./dist
folder.
This task can be useful if one is intended to check if the assets in SharePoint had been changed since last publish or in migration scenarios when some assets are already created in SharePoint (with SharePoint Designer, for instance).
gulp build
Build task combines multiple build actions, such as:
gulp build --prod
Used with Webpack build.
A specific subtasks can be provided as gulp build
parameters:
Parameter | Description |
---|---|
--webpack | webpack'ing .ts to single app.js buldle |
--css-custom | bundling custom css (from .scss) |
--copy-assets | copying static content |
--js-libs | bundling JavaScript libraries |
--css-libs | bundling CSS libraries or custom .css |
--masterpage | .hbs to .masterpage |
--layouts | .hbs to .aspx layouts |
--webparts | compiles .hbs CEWPs |
gulp build --prod --webpack --webparts
Starts webparts and webpack tasks, also uses production build configs.
gulp push
Uploads and publishes ./dist
folder's content to remote spFolder
in SharePoint.
The task uses gulp-spsave for delivering assets to SharePoint.
gulp watch
Watches local files for changes and initiates build and publishing of changed sources.
The task watches for the following sources:
- src
- masterpage
- [watches masterpage .hbs]
- layouts
- [watches layouts.hbs files]
- scripts
- [watches for .ts files changes]
- styles
- [watches for .scss files changes]
- webpartc
- [watches for .hbs files changes]
- masterpage
gulp watch --prod
gulp live
Does the same as gulp watch
, but also emits changed files paths within the live-reload local server.
Implements socket proactive reload using sp-live-reload library.
gulp masterpage
Applies custom masterpage to the SPWeb.
gulp masterpage --uninstall
gulp reload
Installs live-reload client script globally on SPWeb as a User ScriptLink custom action.
gulp reload --uninstall
Remove live-reload client script custom action from SPWeb.
gulp custom-actions
Provisions custom actions from app.json
settings.
gulp custom-actions --uninstall
Removes custom actions based on project namespace prefix.
gulp clean
Deletes ./dist
and temporary fonders.
gulp analyze
Initiates bundles analyzer.