Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declaring multiple AMD dependencies with a function #154

Open
gearboxdesign opened this issue Oct 6, 2015 · 0 comments
Open

Declaring multiple AMD dependencies with a function #154

gearboxdesign opened this issue Oct 6, 2015 · 0 comments

Comments

@gearboxdesign
Copy link

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?

rcampbel added a commit to rcampbel/grunt-contrib-handlebars that referenced this issue Jan 1, 2019
Squashed commit of the following:

commit 6e51bb885e202c237a14bc71910e80bee47eb50e
Author: rcampbel <1334061+rcampbel@users.noreply.github.com>
Date:   Tue Jan 1 04:05:13 2019 -0500

    Updated documentation and changelog

commit 4671b63b32e0a53f6eff4b19f83251ebfa2bbb3d
Author: rcampbel <1334061+rcampbel@users.noreply.github.com>
Date:   Tue Jan 1 04:04:57 2019 -0500

    Encapsulated the logic for processing the AMD content out into it’s own function;  Updated the check for AMD  when seeing if `return` needs to be prepended to the compiled template if a namespace is not being used;

commit babafab72cedfe830a8afde42f4d592e78dfaffe
Author: rcampbel <1334061+rcampbel@users.noreply.github.com>
Date:   Tue Jan 1 04:04:41 2019 -0500

    Added failing tests

commit 33afc8af957ed262561eda03ed727bcee91dad14
Author: rcampbel <1334061+rcampbel@users.noreply.github.com>
Date:   Tue Jan 1 04:04:27 2019 -0500

    Updating node modules, node version dependency, and package version

commit 5a3fd2f802a5daa9dd7564f40f8d9de12bd53953
Author: rcampbel <1334061+rcampbel@users.noreply.github.com>
Date:   Tue Jan 1 04:04:00 2019 -0500

    Updated unit tests to pass prior to making any other change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant