Can I merge multiple webflow.js from different projects?

Hi,

I have 2 different projects created at different times (recently, for what it’s worth), which have been merged offline for use on a separate webhost. As a result they each have a webflow.js file. Since it looks like obfuscated JS I can’t read function names and find duplicates, but there are duplicate sections with these comments:

/*!
 * Webflow: Front-end site library
 * @license MIT
 * Inline scripts may access the api using an async handler:
 *   var Webflow = Webflow || [];
 *   Webflow.push(readyFunction);

and

/*!
 * Webflow._ (aka) Underscore.js 1.6.0 (custom build)
 * _.each
 * _.map
 * _.find
 * _.filter
 * _.any
 * _.contains
 * _.delay
 * _.defer
 * _.throttle (webflow)
 * _.debounce
 * _.keys
 * _.has
 * _.now
 *
 * http://underscorejs.org
 * (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 * Underscore may be freely distributed under the MIT license.
 * @license MIT
 */

The JS for these is different in the 2 webflow.js files, so my concern is that there’s duplicate function names that may cause issues down the line.

One of the projects was the general interface, the other was more animations and accordions but having to merge them in webflow would essentially be starting again, so I’d prefer not to do that.

So my general question is - what’s the recommendation here? Can I just merge them into the one webflow.js file, or will they likely conflict? Both me and the others developing this just assumed that these were just generic backend JS helper functions since it was generically named webflow.js.

Thanks in advance

Why don’t you beautify the files then use source control to compare them?

I gave this a go, and they are quite different. Not only that one is 2500 lines, the other 7700 lines, but they are quite different even for small functions.

In the end we’ve gone back to webflow and merged them into a single project. A quick test shows it is fine, but all the triggers and animations need to be recreated. For some reason, copying between projects preserves the triggers and animations, doesn’t throw any errors, but they need to be recreated for them to work.

If anyone comes across this thread in future - short answer is “no”, long answer is “no, it’s easier to merge them in webflow, re-export and reapply any offline modifications”. That’s my experience, anyway.