-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.js
41 lines (36 loc) · 1.26 KB
/
package.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Package.describe({
name: 'qualia:one',
version: '0.1.0',
summary: 'Prevent two client bundles from being built.',
git: 'http://github.com/qualialabs/one',
documentation: 'README.md'
});
Package.onUse(function(api) {
api.versionsFrom('[email protected]');
api.use([
'ecmascript',
'underscore',
'webapp',
], [ 'server' ]);
api.mainModule('main.js', 'server');
});
/* This code monkey patches build process. It only works if the packages is locally installed. */
var bundleType = process.env.QUALIA_ONE_BUNDLE_TYPE;
if (bundleType === 'modern' || bundleType === 'legacy') {
var path = Npm.require('path'),
mainModule = global.process.mainModule,
absPath = mainModule.filename.split(path.sep).slice(0, -1).join(path.sep),
require = function(filePath) {
return mainModule.require(path.resolve(absPath, filePath));
},
PlatformList = require('./project-context.js').PlatformList,
getWebArchs = PlatformList.prototype.getWebArchs,
blacklist = [
bundleType === 'modern' ? 'web.browser.legacy' : 'web.browser'
]
;
PlatformList.prototype.getWebArchs = function() {
var archs = getWebArchs.apply(this, arguments);
return archs.filter(arch => !blacklist.includes(arch));
}
}