add support for an optional runtime - closes #129

This commit is contained in:
Sebastian McKenzie
2014-11-09 12:02:06 +11:00
parent 8ef5148870
commit ab9cd4e630
8 changed files with 175 additions and 25 deletions

4
bin/6to5-runtime Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
var runtime = require("../lib/6to5/runtime");
console.log(runtime(process.argv[2]));

View File

@@ -10,6 +10,7 @@ commander.option("-t, --source-maps-inline", "Append sourceMappingURL comment to
commander.option("-s, --source-maps", "Save source map alongside the compiled code");
commander.option("-f, --filename [filename]", "Filename to use when reading from stdin - this will be used in source-maps, errors etc [stdin]", "stdin");
commander.option("-w, --watch", "Recompile files on changes");
commander.option("-r, --runtime", "Replace 6to5 declarations with references to a runtime");
commander.option("-m, --modules [modules]", "Module formatter type to use [common]", "common");
commander.option("-w, --whitelist [whitelist]", "Whitelist of transformers to ONLY use", util.list);
@@ -87,6 +88,7 @@ exports.opts = {
blacklist: commander.blacklist,
whitelist: commander.whitelist,
sourceMap: commander.sourceMaps || commander.sourceMapsInline,
runtime: commander.runtime,
modules: commander.modules
};