webpack-sf-upload-resource

1.0.0 • Public • Published

webpack-sf-upload-resource

A small configurable plugin that can zip and deploy bundle files to Salesforce as static resources.

Installation

npm install webpack-sf-upload-resource

Configuration

Modify your webpack.config.js as follows:

var webpackUploadStaticResource = require('webpack-sf-upload-resource');

module.exports = {
    ...
    plugins: [
        new webpackUploadStaticResource(options)
    ]
    ...
};

Options

This plugin supports configuration through the passed in arguments. The options paramater has the structure:

{
    salesforce: {
      username: 'username', // the username to log in to Salesforce with
      password: 'password', // the users password
      token: '', // the security token, if needed. May be null or empty string if not required. Default ''.
      loginUrl: 'https://login.salesforce.com' // the url to log in to salesforce with. Generally one of https://test.salesforce.com or https://login.salesforce.com. Default 'https://login.salesforce.com'.
    },
    resources: [
        {
            name: 'resource1', //the name of the static resource to be created/updated in Salesforce,
            cacheControl: 'Public', // default 'Private'
            files: ['dist/bundle1.js', 'dist/**/*.bundle.js'] // the files to include in the static resource folder, may be in glob format
        }
    ]
}

Readme

Keywords

Package Sidebar

Install

npm i webpack-sf-upload-resource

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • sorochan.roman