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

How to use globalVars? #29

Open
brunomacf opened this issue Apr 25, 2014 · 1 comment
Open

How to use globalVars? #29

brunomacf opened this issue Apr 25, 2014 · 1 comment

Comments

@brunomacf
Copy link

As documentation states the globalVars option prepend variables to the files. But i geting a parse error. The only file i use in assemble-less configuration is main.less that imports a variables.less where i use a template-directory-uri variable that i want to define in assemble-less config. This config is current like this:

less: {
            development: {
                files: {
                    'build/assets/main.css': 'less/main.less'
                },

                options: {
                    globalVars: {
                        'template-directory-uri': 'DEVELOPMENT URI'
                    }
                }
            },

            production: {
                files: {
                    'dist/assets/main.css': less/main.less'
                },

                options: {
                    globalVars: {
                        'template-directory-uri': 'PRODUCTION URI'
                    }
                }
            }
        },

and in the variable.less that is included i have:

@icon-font-path: "@{template-directory-uri}/assets/";

By the way, it would be nice if the process option was applied to every imported less files instead of just the files listed in files item. What do u think about it?

@brunomacf brunomacf changed the title How to use globalVars How to use globalVars? Apr 25, 2014
@brunomacf
Copy link
Author

Ok....weird behavior! If the DEVELOPMENT URI is set to something like http://localhost i just state

'template-directory-uri': "  'http://localhost'  "

for some reason the "" was stripped of and cause a parse error beacuse the variable that is prepended is

@template-directory-uri: http://localhost

and not

@template-directory-uri: "http://localhost"

as it should be!! Weird though!

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