Skip to content

This is a Webpack plugin that allows you upload generated assets to a SharePoint site.

License

Notifications You must be signed in to change notification settings

PooLP/spsave-webpack-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPSave Webpack Plugin

This is a webpack plugin that allows you upload generated assets to a SharePoint site. This uses the spsave plugin to authenticate and upload to SharePoint.

Maintainer: Yohan Belval @yohanb

Installation

Install the plugin with npm:

$ npm install spsave-webpack-plugin --save-dev

Basic Usage

The plugin will upload all your webpack's assets to SharePoint using spsave. Just add the plugin to your webpack config as follows:

var path = require('path');

var SPSaveWebpackPlugin = require('spsave-webpack-plugin');
var root = path.join.bind(path, path.resolve(__dirname));

var webpackConfig = {
  entry: './index.js',
  output: {
    path: root('dist'),
    filename: 'bundle.js'
  },
  plugins: [new SPSaveWebpackPlugin({
            "coreOptions": {
                "checkin": true,
                "checkinType": 1,
                "siteUrl": "[your sharepoint site URL]"
            },
            "credentialOptions": {
                    /* See https://github.com/s-KaiNet/node-sp-auth#params for authentication options */
            },
            "fileOptions": {
                "folder": "Style Library/dist"
            }
        })]
};
module.exports = webpackConfig;

This will upload the dist/bundle.js to the specified folder: SharePoint library result

Configuration

Since the Webpack plugin is based on the spsave node module, all configuration options are virtually identical. The only difference is the fact that you do not need to specify fileOptions other that the destination folder since the uploaded files will be the ones emitted by the Webpack build. NOTE: This plugin is not intended to be used when in a hot-reloading Webpack setup.

License

This project is licensed under MIT.

About

This is a Webpack plugin that allows you upload generated assets to a SharePoint site.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%