I need to remove require.js from a bunch of files. The rest of the code needs to be preserved, and theres plently of nested functions, etc, which complicates things. I've pasted a sample below, basically I need 'use strict' to be the first line of code, and also strip the final }); from the code. Using sublime text 2. any regex or other ideas how to accomplish this?
EDIT: Need to remove everything before 'use strict' in example below, as well as closing }); Code in between, everything below 'use strict' except for the final closing }); needs to be left in tact. That code does contain functions and objects which complicate things. Example of what code may look like:
define([
'backbone',
'common',
'marionette',
'bootstrap'
],
function (Backbone, Common) {
'use strict';
var foo = 'stuff';
foo = Backbone.Marionette.ItemView.extend({
template: 'stuff',
className: 'more stuff',
events: {
"click #a": "s"
},
s: function () {
//
// On click of a button, hide the modal
//
this.$el.modal('hide');
}
});
});