fix(bindings/node): Fix regression of JS APIs (#8998)

**Related issue:**

 - Closes #8997
This commit is contained in:
Donny/강동윤 2024-05-30 18:47:24 +09:00 committed by GitHub
parent 1267e3ecd4
commit 125ddd2dd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
import swc from "..";
import Visitor from "../src/Visitor";
import Visitor from "../Visitor";
function assertAllObjectHasTypeFiled(obj, desc = '') {
if (Array.isArray(obj)) {

View File

@ -1,5 +1,5 @@
const swc = require("../../");
const Visitor = require("../../src/Visitor").default;
const Visitor = require("../../Visitor").default;
{
const src = `

View File

@ -23,7 +23,7 @@ const bindings: typeof import("../binding") = (() => {
try {
binding = !!bindingsOverride
? require(resolve(bindingsOverride))
: require("../binding.js");
: require("./binding.js");
// If native binding loaded successfully, it should return proper target triple constant.
const triple = binding.getTargetTriple();
@ -40,7 +40,7 @@ const bindings: typeof import("../binding") = (() => {
/**
* Version of the swc binding.
*/
export const version: string = require("../package.json").version;
export const version: string = require("./package.json").version;
/**
* @deprecated JavaScript API is deprecated. Please use Wasm plugin instead.

View File

@ -12,7 +12,7 @@
"sourceMap": false /* Generates corresponding '.map' file. */,
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./" /* Redirect output structure to the directory. */,
"rootDir": "./" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
"rootDir": "./src/" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
// "composite": true, /* Enable project compilation */
"removeComments": false /* Do not emit comments to output. */,
// "noEmit": true, /* Do not emit outputs. */