Comparing version 0.1.18 to 0.1.19
{ | ||
"name": "@swc/cli", | ||
"version": "0.1.18", | ||
"version": "0.1.19", | ||
"description": "CLI for the swc project", | ||
"main": "index.js", | ||
"scripts": { | ||
"prepublish": "tsc", | ||
"test": "jest" | ||
@@ -23,3 +24,3 @@ }, | ||
], | ||
"author": "강동윤 <kdy1@outlook.kr>", | ||
"author": "강동윤 <kdy1997.dev@gmail.com>", | ||
"license": "MIT", | ||
@@ -26,0 +27,0 @@ "bugs": { |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -8,0 +9,0 @@ }); |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -8,0 +9,0 @@ }); |
@@ -34,2 +34,3 @@ "use strict"; | ||
commander_1.default.option("--include-dotfiles", "Include dotfiles when compiling and copying non-compilable files"); | ||
commander_1.default.option("-C, --config <config>", "Override a config from .swcrc file. e.g. -C module.type=amd -C module.moduleId=hello", collect); | ||
commander_1.default.version(`@swc/cli: ${package_json_1.default.version} | ||
@@ -102,2 +103,24 @@ @swc/core: ${core_1.version}`); | ||
}; | ||
for (const cfg of opts.config) { | ||
const i = cfg.indexOf('='); | ||
let key, value; | ||
if (i === -1) { | ||
key = cfg; | ||
value = true; | ||
} | ||
else { | ||
key = cfg.substring(0, i); | ||
value = cfg.substring(i + 1); | ||
} | ||
let obj = swcOptions; | ||
const ks = key.split('.'); | ||
for (const k of ks.slice(0, ks.length - 1)) { | ||
if (!obj[k]) { | ||
obj[k] = {}; | ||
} | ||
obj = obj[k]; | ||
} | ||
obj[ks[ks.length - 1]] = value; | ||
} | ||
console.log(swcOptions); | ||
let cliOptions = { | ||
@@ -104,0 +127,0 @@ outDir: opts.outDir, |
{ | ||
"name": "@swc/cli", | ||
"version": "0.1.18", | ||
"version": "0.1.19", | ||
"description": "CLI for the swc project", | ||
"main": "index.js", | ||
"scripts": { | ||
"prepublish": "tsc", | ||
"test": "jest" | ||
@@ -23,3 +24,3 @@ }, | ||
], | ||
"author": "강동윤 <kdy1@outlook.kr>", | ||
"author": "강동윤 <kdy1997.dev@gmail.com>", | ||
"license": "MIT", | ||
@@ -26,0 +27,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39270
19
781