Skip to content

Latest commit

 

History

History
48 lines (25 loc) · 1.25 KB

README.md

File metadata and controls

48 lines (25 loc) · 1.25 KB

VTEX Front End Utils

Common extensions used by various projects

Structure

This repo contains several directories under src/, each with common snippets, extensions or patterns used accross projects.

Usually, they are grouped by the framework or library that they extend, i.e. angular, knockout, underscore.

Exporting

You can expect that any given file will be exported to the global window under the following template:

window.vtex.{path}

Directories will be expanded into namespaces and dashes (my-file) will be converted to camelCase (myFile).

For example, the common/append-template.coffee will be exported into window.vtex.common.appendTemplate.

Importing with webpack

If your project uses webpack, you can require the dependencies from the window via webpack externals configuration.

For example:

externals: {
    // require("appendTemplate") is external and available
    //  on the global var window.vtex.common.appendTemplate
    "appendTemplate": "window.vtex.common.appendTemplate"
}

Common

Knockout

Angular

Underscore

underscore-extensions extends the global _ with new utilitary functions.


VTEX - 2015