Kevin Hill
Kevin Hill

Reputation: 319

How to add .js file to netsuite SCA Denali / Mont-Blanc

I am currently editing a Netsuite SCA implementation - and need to add a .js file to the site.

In SiteBuilder this was fairly simple with editing templates. However, with SCA it looks like we need quite a bit more configuration to make it happen.

I'd welcome some help from the community on how to add a .js file.

Thank you

Upvotes: 1

Views: 118

Answers (1)

Matthew Wilson
Matthew Wilson

Reputation: 2065

If it is a third party module create a new directory for it under Modules/third_parties/[email protected]

If its a custom javascript file create a new folder under Modules/MyCustomModules/[email protected]

Create a JavaScript folder under [email protected]/JavaScript and place your file in there.

Create a ns.package.json file at the root of [email protected], with the following contents:

{
    "gulp": {
        "javascript": [
            "JavaScript/*"
        ]
    },
    "jshint": "false"
}

Open the distro.json file at the root of the SCA application and add your module to the modules object:

If you added your module to thrid_parties use:

"third_parties/MyModule":"1.0.0"

If you added a new MyCustomModules folder use:

"MyCustomModules/MyModule":"1.0.0"

Then add MyModule to the dependencies object in the distro.json for each application. E.g. if you only use the js file in the shopping application, add it to the dependencies object for the SC.Shopping.Starter entrypoint.

Then gulp deploy to deploy your new module

Upvotes: 2

Related Questions