1.2.7 • Published 1 year ago

sfmc-boilerplate v1.2.7

Weekly downloads
16
License
MIT
Repository
github
Last release
1 year ago

SFMC Boilerplate

bundle your scripts for Cloudpages & E-Mails easily and automated

NPM

Installation

> npm install --save-dev sfmc-boilerplate

Usage

run npx sfmc-build in the root of your project to see all available commands.

Config files (email.json / cloudpage.json)

This required file is used to specify loading order and other details for compiling your code. Place it inside of each folder where you keep the source files for one email or one cloudpage.

{
    "name": "name of your page or email",
    "author": "joern.berkefeld@some-mail.com",
    "server": {
        "coreVersion": "1.1.1",
        "scriptAttributes": {
            "executioncontexttype": "post"
        },
        "dependencies": {
            "other": ["server/lib/lib.something.html"],
            "ssjs": ["server/lib/lib.ab.ssjs", "server/lib/lib.cd.ssjs"]
        },
        "src": ["server/server.ssjs"]
    },
    "public": ["public/index.html", "public/style.css", "public/app.js"],
    "dest": "dist/bundle.html",
    "template": {
        "DEV":{
        },
        "QA": {
            "_DEV": "_QA"
        },
        "PROD": {
            "_DEV": ""
        }
    }
}
ParameterDescription
nameidentifies how the page or email is called in SFMC
authorname or email of author
server.coreVersionthis is used to insert "Platform.Load("core", "x.x.x");" before any SSJS code
server.scriptAttributesdefine any attributes you want to see on auto-inserted <script> tags for SSJS
server.dependenciesput any re-usable libraries that you will not modifiy as part of the current app here
server.dependencies.ssjsall SSJS lib files; code will be wrapped in one single <script runat="server">...</script>
server.dependencies.otherany non-SSJS lib files (HTML, AMP, mixed); no wrapping code will be added
server.srcthis is where your server-side app goes. You can use multipe files as well if needed
publiclist your front end files here; any type is supported. JS & CSS will be autowrapped in their own <script> / <style> nodes
destdefine the path and file name of your output file. The path is relative to the cloudpage.json
templateallows you to do string replacements and will output dedicated bundles per template

License

MIT licensed

1.2.7

1 year ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.0

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago