-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.js
55 lines (47 loc) · 1.64 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Package.describe({
summary: "Allows templates to be defined in .hamlet files",
internal: true
});
// Today, this package is closely intertwined with Handlebars, meaning
// that other templating systems will need to duplicate this logic. In
// the future, perhaps we should have the concept of a template system
// registry and a default templating system, ideally per-package.
Package._transitional_registerBuildPlugin({
name: "compileTemplates",
use: ['handlebars'],
sources: [
'plugin/html_scanner.js',
'plugin/compile-hamlet-templates.js'
]
});
// This on_use describes the *runtime* implications of using this package.
Package.on_use(function (api) {
// XXX would like to do the following only when the first html file
// is encountered
api.use(['underscore', 'spark', 'handlebars'], 'client');
api.export('Template', 'client');
// provides the runtime logic to instantiate our templates
api.add_files('deftemplate.js', 'client');
// html_scanner.js emits client code that calls Meteor.startup and
// Spark.render, so anybody using templating (eg apps) need to implicitly use
// 'meteor' and 'spark'.
api.imply(['meteor', 'spark'], 'client');
});
Package.on_test(function (api) {
api.use('tinytest');
api.use('htmljs');
api.use('templating');
api.use('handlebars');
api.use('underscore');
api.use(['test-helpers', 'domutils', 'session', 'deps',
'spark', 'minimongo'], 'client');
api.use('handlebars', 'server');
// api.add_files([
// 'templating_tests.js',
// 'templating_tests.html'
// ], 'client');
api.add_files([
'plugin/html_scanner.js',
// 'scanner_tests.js'
], 'server');
});