UNPKG

911 BJavaScriptView Raw
1#!/usr/bin/env node
2"use strict";
3Object.defineProperty(exports, "__esModule", { value: true });
4const commandLineArgs = require("command-line-args");
5const src_1 = require("../src");
6exports.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};