A Babel plugin to namespace (prefix) AMD define() calls.
npm install babel-plugin-namespace-amd-define> Add a prefix to AMD define() calls.
In
``javascript`
define([], function () {});
Out
`javascript`
Liferay.Loader.define([], function () {});
`sh`
npm install --save-dev babel-plugin-namespace-amd-define
Add the following to your .babelrc file:
Without options:
`json`
{
"plugins": ["namespace-amd-define"]
}
With options:
`json`
{
"plugins": [
[
"namespace-amd-define",
{
"namespace": "window.MyProject.Loader"
}
]
]
}
This module adds a prefix to any AMD define() call that it finds. The prefix is specified with the namespace option and a period is inserted between the namespace string and the define() call.
By default, the namespace option is set to Liferay.Loader`.