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

Fixes #1619 #1658

Merged
merged 2 commits into from
Nov 17, 2013
Merged

Fixes #1619 #1658

merged 2 commits into from
Nov 17, 2013

Conversation

joshuaspence
Copy link
Contributor

The latest version (1.5.0) of less.js conflicts with require.js (if loaded before require.js), causing the following error:

Uncaught TypeError: Object function require(a){return window.less[a.split("/")[1]]} has no method 'config'

It seems that this is only an issue with the minified version (less-1.5.0.min.js) because the minified JavaScript is not wrapped in an anonymous closure. Adding function(){ to the beginning and }()) to the end of the minified file.

@lukeapage
Copy link
Member

Thanks.. will look into this.. would like to clarify why uglify is removing the wrapper if it only effects minified and make sure less is still defined globally.

@joshuaspence
Copy link
Contributor Author

uglify isn't removing the wrapper. The wrapper is being added by the grunt concat:browser task (https://github.com/less/less.js/blob/master/Gruntfile.js#L50) which isn't executed during uglify:browser.

I am going to update my pull request with (IMO) a better solution.

@lukeapage
Copy link
Member

perfect, thanks

lukeapage added a commit that referenced this pull request Nov 17, 2013
@lukeapage lukeapage merged commit 3567fa9 into less:master Nov 17, 2013
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.

2 participants