sp-build-tasks
👷 SharePoint front-end projects automation and tasks tool-belt
Last updated
👷 SharePoint front-end projects automation and tasks tool-belt
Last updated
The library was designed for usage with SharePoint Push-n-Pull Yeoman generator but can be used as a stand-alone package as well.
Settings
Parameter
Description
privateConf
appConfig
path to application config file
taskPath
path to custom gulp tasks folder
The app config file should be a JSON document with the following schema sp-build-tasks/schema/v1/sppp.json
.
The schema represents the following interface:
Custom Gulp tasks
or types supported version:
Populates ./config/private.json
with credentials options.
Watch
Watch for changes in ./src
folder, compiles .ts, .hbs and .scss to ./dist
. Watch for changes in ./dist
and uploads to target SharePoint folder.
Watch with SharePoint pages live reload
Does the same as the watch
task. Emits files update to SharePoint live reload client which triggers live pages reload for:
JavaScript's updates
CSS's updates
CEWPs updates
Layouts updates
Masterpage updates
Publishing ./dist to SharePoint
Publishes all ./dist
folder content to SharePoint target folder.
Publishing in incremental mode
Uploads only files which size is different from those in SharePoint.
Fetching files from SharePoint
Downloads all files and folders from remote SharePoint target to ./dist
folder.
Compiles front-end to ./dist
folder.
Build options
Production build
Used with Webpack build.
Build subtasks
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
Starts webparts and webpack tasks, also uses production build configs.
Live reload
Installs live reload client as ScriptLink custom action to SPWeb.
Retracts live reload custom action client.
Masterpage
Applies custom masterpage and logo to SPWeb.
Restores default (seattle.masterpage) masterpage.
Custom actions
Provisions custom actions from app.json
settings.
Removes custom actions based on project namespace prefix.
Checkout this end-to-end sample.
path to config file