export default function(result, options) {
    const styles = result.styles.map(stylesPath => {
        return `require('${stylesPath}')`;
    }).join('; ');
    const createFactory = `require('react').createFactory`;
    const inject = `module.__yummies__ = module.__yummies__ || {}; module.__yummies__['${result.component}'] = '${result.raw}'`;

    if (options.injectable) {
        if (result.opts.inject === true) {
            if (result.opts.class === true) {
                return `/* ${result.raw} */ function(injects) { return require('@yummies/layers-loader/build/inject!${result.component}')(injects); }; ${styles}`;
            }

            return `/* ${result.raw} */ function(injects) { return ${createFactory}(require('@yummies/layers-loader/build/inject!${result.component}')(injects)); }; ${styles}`;
        }

        if (result.opts.class === true) {
            return `/* ${result.raw} */ (function() {
                ${inject};

                var out = require('${result.component}');

                ${styles};

                return out;
            })()`;
        }

        return `/* ${result.raw} */ (function() {
            ${inject};

            var out = ${createFactory}(
                require('${result.component}')
            );

            ${styles};

            return out;
        })()`;
    }

    if (result.opts.class === true) {
        return `/* ${result.raw} */ require('${result.component}'); ${styles}`;
    }

    return `/* ${result.raw} */ ${createFactory}(require('${result.component}')); ${styles}`;
}

@@ -339,16 +339,156 @@
 .raw%7D'%60;
+%0A    const requireEs6 = (path) =%3E %60function(obj)%7B return obj && obj.__esModule ? obj : %7B %5C'default%5C': obj %7D; %7D(require('$%7Bpath%7D')).default%60;
 %0A%0A    if
@@ -862,25 +862,30 @@
 actory%7D(
+$%7B
 require
-('
+Es6(%60
 @yummies
@@ -923,34 +923,35 @@
 esult.component%7D
-')
+%60)%7D
 (injects)); %7D; $
@@ -1358,36 +1358,21 @@
 ry%7D(
-%0A                
+$%7B
 require
-('$%7B
+Es6(
 resu
@@ -1387,24 +1387,10 @@
 nent
+)
 %7D
-')%0A            
 );%0A%0A
@@ -1633,27 +1633,29 @@
 actory%7D(
+$%7B
 require
-('$%7B
+Es6(
 result.c
@@ -1662,19 +1662,18 @@
 omponent
-%7D'
 )
+%7D
 ); $%7Bsty

Fix for export default and webpack