Common extensions used by various projects
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.
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.
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"
}
underscore-extensions extends the global _ with new utilitary functions.
VTEX - 2015