Skip to content

Commit

Permalink
use ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Nov 11, 2022
1 parent 03f42fb commit 66ff4a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 32 deletions.
32 changes: 2 additions & 30 deletions packages/next/compiled/@edge-runtime/cookies/index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/index.ts
var src_exports = {};
__export(src_exports, {
RequestCookies: () => RequestCookies,
ResponseCookies: () => ResponseCookies
});
module.exports = __toCommonJS(src_exports);

// src/serialize.ts
function serialize(c) {
const attrs = [
Expand Down Expand Up @@ -210,8 +183,7 @@ function normalizeCookie(cookie = { name: "", value: "" }) {
}
return cookie;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
export {
RequestCookies,
ResponseCookies
});
};
2 changes: 1 addition & 1 deletion packages/next/compiled/@edge-runtime/cookies/package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"@edge-runtime/cookies","version":"3.0.1","main":"./index.js","license":"MPLv2"}
{"name":"@edge-runtime/cookies","version":"3.0.1","main":"./index.js","type":"module","license":"MPLv2"}
3 changes: 2 additions & 1 deletion packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,12 @@ export async function ncc_edge_runtime_cookies() {
name: '@edge-runtime/cookies',
version: pkg.version,
main: './index.js',
type: 'module',
license: pkg.license,
})

await fs.copy(
require.resolve('@edge-runtime/cookies'),
require.resolve('@edge-runtime/cookies/dist/index.mjs'),
join(dest, 'index.js')
)
await fs.copy(
Expand Down

0 comments on commit 66ff4a7

Please sign in to comment.