1 | #!/usr/bin/env node
|
2 | "use strict";
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | const commandLineArgs = require("command-line-args");
|
5 | const src_1 = require("../src");
|
6 | exports.default = args => {
|
7 | const optionsDefinitions = [
|
8 | { name: 'no-watcher', type: Boolean, defaultOption: false },
|
9 | { name: 'prefix-tag', type: String },
|
10 | { name: 'suffix-tag', type: String }
|
11 | ];
|
12 | const options = commandLineArgs(optionsDefinitions, { camelCase: true, argv: args, partial: true });
|
13 | const transpiler = new src_1.default({
|
14 | watchFiles: !options.noWatcher,
|
15 | tagNamePrefix: options.prefixTag,
|
16 | tagNameSuffix: options.suffixTag
|
17 | });
|
18 | process.on('message', message => {
|
19 | if (message === 'refresh') {
|
20 | transpiler.refresh();
|
21 | }
|
22 | });
|
23 | transpiler.on('STOP', () => {
|
24 | process.exit(0);
|
25 | });
|
26 | transpiler.run();
|
27 | };
|