node-webresourcedeprecated

Node module to upload web resources to Dynamics 365

Usage no npm install needed!

<script type="module">
  import nodeWebresource from 'https://cdn.skypack.dev/node-webresource';
</script>

README

node-webresource

Node module for publishing Dynamics 365 web resources, inspired by gulp-webresource

Build NPM Semantic-Release
Build Status npm semantic-release

Usage

npm install -D node-webresource

Sign in here to grant access to your Dynamics 365 organization.

Sample config file and usage

For a more complete sample using webpack, see generator-xrm-webresource

var uploadConfig = {
    tenant: "mycompany.onmicrosoft.com",
    server: "https://mycompany.crm.dynamics.com",
    webResources: [
        {
            "path": "path\\to\\file\\formscript.js",
            "name": "new_formscript.js"
        }
    ],
    solution: "MySolution"
};

// Can use username/password or client id/secret
uploadConfig.username: "me@mycompany.onmicrosoft.com";
uploadConfig.password: "MyPassword";
uploadConfig.clientId: "ClientId";
uploadConfig.clientSecret: "ClientSecret";

var assets = [
    {
        path: "path\\to\\file\\formscript.js", // Should match webResources path
        content: "function onLoad() {}"
    };
];

webResource.upload(uploadConfig, assets).then(() => {
    callback();
}, (error) => {
    console.log(error);
    callback();
});