Socket
Socket
Sign inDemoInstall

@swc/cli

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swc/cli - npm Package Compare versions

Comparing version 0.3.12 to 0.3.13

43

lib/swc/compile.js

@@ -46,6 +46,20 @@ "use strict";

output.code += `\n//# sourceMappingURL=${(0, _slash.default)((0, _path.relative)(destDir, sourceMapPath))}`;
let dts;
// TODO: Remove once fixed in core
if (output.output) {
const json = JSON.parse(output.output);
if (json.__swc_isolated_declarations__) {
dts = json.__swc_isolated_declarations__;
}
}
let dtsPath;
if (dts) {
dtsPath = (0, _path.join)(destDir, (0, _path.basename)(destFile) + ".d.ts");
}
return {
sourceMap: output.map,
sourceMapPath,
sourceCode: output.code
sourceCode: output.code,
dts,
dtsPath
};

@@ -55,3 +69,3 @@ }

const destDir = (0, _path.dirname)(destFile);
const { sourceMap, sourceMapPath, sourceCode } = withSourceMap(output, options, destFile, destDir);
const { sourceMap, sourceMapPath, sourceCode, dts, dtsPath } = withSourceMap(output, options, destFile, destDir);
await mkdir(destDir, {

@@ -61,16 +75,15 @@ recursive: true

const { mode } = await stat(sourceFile);
if (!sourceMapPath) {
await writeFile(destFile, sourceCode, {
const dtsPromise = dts ? writeFile(dtsPath, dts, {
mode
}) : Promise.resolve();
const sourceMapPromise = sourceMapPath ? writeFile(sourceMapPath, sourceMap, {
mode
}) : Promise.resolve();
await Promise.all([
writeFile(destFile, sourceCode, {
mode
});
} else {
await Promise.all([
writeFile(destFile, sourceCode, {
mode
}),
writeFile(sourceMapPath, sourceMap, {
mode
})
]);
}
}),
dtsPromise,
sourceMapPromise
]);
}

@@ -77,0 +90,0 @@ async function compile(filename, opts, sync, outputPath) {

{
"name": "@swc/cli",
"version": "0.3.12",
"version": "0.3.13",
"description": "CLI for the swc project",

@@ -46,4 +46,5 @@ "main": "lib/swc/index.js",

"devDependencies": {
"@swc/cli": "=0.3.6",
"@swc/core": "^1.3.107",
"@swc/cli": "=0.3.12",
"@swc/core": "^1.6.4",
"@swc/types": "^0.1.9",
"@types/jest": "^29.5.0",

@@ -50,0 +51,0 @@ "@types/node": "^20.11.5",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc