Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk committed Apr 13, 2024
1 parent 3a49b02 commit 15cf31c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as module from "./module";
import { obj3, obj3CanMangle, obj4, obj4CanMangle } from "./reexport?side-effects" // enable side effects to ensure reexport is not skipped
import data from "./data.json";
import fs from "fs/promises";
import fs from "fs";
import path from "path";

it("should mangle export when destructuring module", () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ it("should mangle when destructuring json", async () => {
expect(values[2]).toBe(5);
expect(values[3]).toBe(3);
const info = JSON.parse(await fs.readFile(path.resolve(__dirname, "json-exports-info.json"), 'utf-8'));
const info = JSON.parse(await fs.promises.readFile(path.resolve(__dirname, "json-exports-info.json"), 'utf-8'));
const exportsInfo = info["main"]["./data.json"];
expect(exportsInfo.foo.usedName !== "foo").toBe(true);
expect(exportsInfo.obj.usedName !== "obj").toBe(true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { getRuntimeKey } = require("../../../../lib/util/runtime");
// const { getRuntimeKey } = require("../../../../lib/util/runtime");

/** @type {import("../../../../").Configuration} */
module.exports = {
Expand Down Expand Up @@ -33,7 +33,7 @@ module.exports = {
};
const map = {};
for (const chunk of compilation.chunks) {
const map2 = (map[getRuntimeKey(chunk.runtime)] = {});
const map2 = (map[chunk.runtime] = {});
for (const module of compilation.modules) {
if (module.type !== "json") continue;
const map3 = (map2[
Expand Down

0 comments on commit 15cf31c

Please sign in to comment.