-
Notifications
You must be signed in to change notification settings - Fork 608
Expand file tree
/
Copy pathregister.js
More file actions
57 lines (49 loc) · 1.29 KB
/
register.js
File metadata and controls
57 lines (49 loc) · 1.29 KB
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
56
57
'use strict';
import {
AngularTsCompiler
} from 'meteor/angular-typescript-compiler';
import {
AngularHtmlCompiler
} from 'meteor/angular-html-compiler';
import {
AngularScssCompiler
} from 'meteor/angular-scss-compiler';
let templateExtension = 'html';
if(process.env.BLAZE){
templateExtension = 'ng.html';
}
let aot = ((process.env.NODE_ENV == 'production') && (process.env.AOT != '0')) || process.env.AOT == '1';
let rollup = (process.env.ROLLUP == '1');
let compiler, compilerCli;
try{
if(aot){
compiler = require('@angular/compiler');
compilerCli = require('@angular/compiler-cli');
}
}catch(e){
console.error(e);
console.log('@angular/compiler and @angular/compiler-cli must be installed for AOT compilation!');
console.log('AOT compilation disabled!');
console.log('Ignore this if you are using AngularJS 1.X');
aot = false;
rollup = false;
}
Plugin.registerCompiler({
extensions: ['ts', 'tsx'],
filenames: ['tsconfig.json']
}, () => new AngularTsCompiler({
aot,
rollup,
compiler,
compilerCli
}));
Plugin.registerCompiler({
extensions: [templateExtension]
}, () => new AngularHtmlCompiler({
aot
}));
Plugin.registerCompiler({
extensions: ['scss']
}, () => new AngularScssCompiler({
aot
}));