Skip to content

Fixes #1619#1658

Merged
lukeapage merged 2 commits intoless:masterfrom
joshuaspence:master
Nov 17, 2013
Merged

Fixes #1619#1658
lukeapage merged 2 commits intoless:masterfrom
joshuaspence:master

Conversation

@joshuaspence
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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