Minification failed. Strict-mode does not allow assignment to undefined variables: Sortable
I'm getting this error when trying to minify sortable.js in Visual Studio 2015 (MVC project):
Minification failed. Returning unminified contents. (689,213-221): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: Sortable
Bindings: jquery.binding.js and sortable.js v1.5.0-rc1
Not sure how to fix it, but as a work around I'm creating a separate script bundle that is not minified
The problem is the line 18 - it assigns factory() to the global object Sortable that is not defined before. This is not allowed in strict mode. I already created a fix for this issue long time ago, but it wasn't merged.
As workaround you can pass global context to the IIFE and assign Sortable to it, something like this:
(function(global, factory) {
"use strict";
// instead of Sortable = factory();
global["Sortable"] = factory();
})(this, function() { return {}; });
Try master