From: Tim Düsterhus Date: Wed, 20 May 2015 22:40:23 +0000 (+0200) Subject: Fix code style in require.build.js X-Git-Tag: 3.0.0_Beta_1~2368 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b8ebfcc222d8a5b92548085e885be50f1d11a437;p=GitHub%2FWoltLab%2FWCF.git Fix code style in require.build.js --- diff --git a/wcfsetup/install/files/js/require.build.js b/wcfsetup/install/files/js/require.build.js index 43c40b2624..4441549c02 100644 --- a/wcfsetup/install/files/js/require.build.js +++ b/wcfsetup/install/files/js/require.build.js @@ -9,33 +9,35 @@ paths: { "requireLib": "require", - "jquery": "empty:", + "jquery": "empty:" }, include: [ - "requireLib", + "requireLib" ], excludeShallow: [ - 'WoltLab/_Meta', + 'WoltLab/_Meta' ], rawText: { - 'WoltLab/_Meta': 'define([], function () {});', + 'WoltLab/_Meta': 'define([], function() {});' }, - onBuildRead: function (moduleName, path, contents) { + onBuildRead: function(moduleName, path, contents) { if (!process.versions.node) { throw new Error('You need to run node.js'); } if (moduleName === 'WoltLab/_Meta') { if (global.allModules == undefined) { - var fs = module.require('fs') - , path = module.require('path'); + var fs = module.require('fs'), + path = module.require('path'); global.allModules = []; - var queue = [ 'WoltLab' ]; + + var queue = ['WoltLab']; var folder; while (folder = queue.shift()) { var files = fs.readdirSync(folder); for (var i = 0; i < files.length; i++) { var filename = path.join(folder, files[i]); + if (path.extname(filename) == '.js') { global.allModules.push(filename); } @@ -46,9 +48,9 @@ } } - return 'define([' + global.allModules.map(function (item) { return "'" + item.replace(/\\/g, '\\\\').replace(/'/g, "\\'") + "'"; }).join(', ') + '], function () { });'; + return 'define([' + global.allModules.map(function (item) { return "'" + item.replace(/\\/g, '\\\\').replace(/'/g, "\\'") + "'"; }).join(', ') + '], function() { });'; } return contents; - }, + } })