Skip to content

Commit

Permalink
fix(bindings/node): Fix regression of JS APIs (#8998)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #8997
  • Loading branch information
kdy1 committed May 30, 2024
1 parent 1267e3e commit 125ddd2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/__tests__/plugin_test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import swc from "..";
import Visitor from "../src/Visitor";
import Visitor from "../Visitor";

function assertAllObjectHasTypeFiled(obj, desc = '') {
if (Array.isArray(obj)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/__tests__/transform/plugin_test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const swc = require("../../");
const Visitor = require("../../src/Visitor").default;
const Visitor = require("../../Visitor").default;

{
const src = `
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 125ddd2

Please sign in to comment.