Apply interpolated weights to the model on export

When skinning a model, you can do a weight painting and then add a subsurf modifier to smoothly interpolate the vertices. To do this I have the subsurface modifier below the armature modifier on the stack.

Now when exporting the model, this smooth interpolation doesn’t seem to get applied to the vertices. Instead I get the same effect as when subsurf modifier is above armature modifier on the stack. Is there a way to apply the interpolated weights on export?

I have a custom export script, where I apply modifiers in this succession: mirror modifier, armature, subsurf modifier.