mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
fix(npm): handle cjs re-exports with the same name as an export (#15626)
This commit is contained in:
parent
9b324b1cf4
commit
ec98d86d21
7 changed files with 59 additions and 8 deletions
19
cli/tests/testdata/npm/registry/@denotest/cjs-reexport-collision/1.0.0/index.js
vendored
Normal file
19
cli/tests/testdata/npm/registry/@denotest/cjs-reexport-collision/1.0.0/index.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
// collision will occur with __esModule in other_file.js
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const other_file_1 = __importDefault(require("./other_file"));
|
||||
__exportStar(require("./other_file"), exports);
|
||||
exports.default = other_file_1.default;
|
10
cli/tests/testdata/npm/registry/@denotest/cjs-reexport-collision/1.0.0/other_file.js
vendored
Normal file
10
cli/tests/testdata/npm/registry/@denotest/cjs-reexport-collision/1.0.0/other_file.js
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
class Hello {
|
||||
sayHello() {
|
||||
console.log("Hi.");
|
||||
}
|
||||
}
|
||||
// conflict will be with __esModule
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hello = new Hello();
|
||||
exports.default = new Hello();
|
5
cli/tests/testdata/npm/registry/@denotest/cjs-reexport-collision/1.0.0/package.json
vendored
Normal file
5
cli/tests/testdata/npm/registry/@denotest/cjs-reexport-collision/1.0.0/package.json
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "@denotest/cjs-reexport-collision",
|
||||
"version": "1.0.0",
|
||||
"main": "./index.js"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue