HenrikJoreteg / moonboots

A set of conventions and tools for bundle and serving clientside apps with node.js
158 stars 20 forks source link

insert semi-colon to prevent 'undefined is not a function' #31

Closed aaronmccall closed 10 years ago

aaronmccall commented 10 years ago

Certain libraries don't play nice with moonboots' approach to library and browserified-app concatenation. The safest approach is as follows: The line at index.js#L350 should be modified from

                self.result.js.source = self.result.js.source + js;

to

                self.result.js.source = self.result.js.source + ";" + js;

The lines at index.js#L428-433 should be modified from

// a few helpers
function concatFiles(arrayOfFiles) {
    return arrayOfFiles.map(function (fileName) {
        return fs.readFileSync(fileName);
    }).join('\n');
}

to:

// a few helpers
function concatFiles(arrayOfFiles) {
    return arrayOfFiles.map(function (fileName) {
        return fs.readFileSync(fileName);
    }).join(';\n'); 
}