infernojs / babel-plugin-inferno

Transforms JSX to InfernoJS vNodes
MIT License
79 stars 26 forks source link

brunch watch: Variables not hoisted #55

Closed bcosca closed 5 years ago

bcosca commented 5 years ago

This may be related to https://github.com/infernojs/babel-plugin-inferno/issues/52.

This code snippet is missing in the compiled output when brunch watch detects a change in the code and recompiles it:

var createVNode = Inferno.createVNode,
    createComponentVNode = Inferno.createComponentVNode,
    createTextVNode = Inferno.createTextVNode;

Calling brunch build on the command line after each code change does not exhibit said behavior.

bcosca commented 5 years ago

brunch-config.js:

(function() {

    const
        SRC='src/',
        DST='../pub/';

    module.exports = {
        plugins:{
            babel:{
                presets:['@babel/preset-env'],
                plugins:[
                    ['babel-plugin-inferno',{imports:false}]
                ]
            },
            terser:{
                sourceMap:true
            }
        },
        paths:{
            public:DST,
            watched:[SRC]
        },
        files:{
            javascripts:{
                joinTo:{
                    'js/app.min.js':[SRC+'js/*']
                }
            },
            stylesheets:{
                joinTo:{
                    'css/app.min.css':SRC+'css/*'
                }
            }
        },
        modules:{
            autoRequire:{
                'js/app.min.js':['app.jsx']
            },
            nameCleaner:function(path) {
                return path.replace(/src\/js\//,'');
            }
        },
        npm:{
            enabled:false
        },
        notifications:false,
        //optimize:true
    };

})();
bcosca commented 5 years ago

Like the previously mentioned bug report, Inferno is declared as external and global.

bcosca commented 5 years ago

No feedback for quite some time. Gives us an idea how well supported this software is.

Havunen commented 5 years ago

@bcosca This is babel plugin, brunch tooling and integration is out of scope of this plugin...