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

support for compiling ember components #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dlai0001
Copy link

Allows you to specify a componentsRegEx that'll prefix components with 'components/' in the template name so they can be used as Ember Components.

@dlai0001
Copy link
Author

I think I might of have some sort of auto convert tabs to spaces that makes the change bigger than it really is. Most of it is just a change from a conditional that switched between a partial and a normal template to a if/else if/else block that also support components.

//process var name/namespace of template.
+                    if (isPartial.test(_.last(filepath.split('/'))) ) {
+                        filename = processPartialName(filepath);
+                        templates.push(nsInfo.namespace+'['+JSON.stringify(filename)+'] = '+compiled+';');
+                    } else if(isComponent.test(filepath)){
+                        filename = processName(filepath);
+                        templates.push(nsInfo.namespace + "[" + JSON.stringify( 'components/' + filename)+"] = " +compiled+';');
+                    } else {
+                        filename = processName(filepath);
+                        templates.push(nsInfo.namespace +'['+JSON.stringify(filename)+'] = '+compiled+';');
+                    }

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

Successfully merging this pull request may close these issues.

1 participant