Skip to content

Declaring multiple AMD dependencies with a function #154

@gearboxdesign

Description

@gearboxdesign

Hi all,

I might be doing something daft here but I would have thought that when using a function as the AMD option I would be able to define a series of dependencies, i.e. an array and not just a string.

For example (config):

amd: function (filename, ast) {
    return ['vendor/handlebars'].concat(searchAST('type', 'PartialStatement', ast).map(function (partial) {
        return 'templates/' + partial.name.original;
    }));
}

My searchAST function is fine and successfully returns the array I wanted but the output of the precompiled target is this:

define(['vendor/handlebars,templates/_e-form-checkbox,templates/_e-form-range'], function(Handlebars) {

So a super long concatenated dep path which of course doesn't exist.

Is it something I have done or is this not supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions