Bundling: Fix for new bundle

This fixes #1121 : impossible to create a new JS bundle with WE 2.1.3. I checked for #1071 and I think it's still OK but it's a long specific thread so maybe @am11 can take a look.