Skip to content

Commit 328becf

Browse files
authored
take type field from package.json (#88)
1 parent a9ea8ff commit 328becf

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.changeset/neat-garlics-return.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/build-utils": patch
3+
---
4+
5+
Take `type` from package.json

src/PackV5.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const run = Effect.gen(function*() {
4747
const buildPackageJson = Effect.sync(() => {
4848
const out: Record<string, any> = {
4949
name: ctx.packageJson.name,
50+
type: ctx.packageJson.type,
5051
version: ctx.packageJson.version,
5152
description: ctx.packageJson.description,
5253
license: ctx.packageJson.license,

src/PackageContext.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ export class PackageJson extends Schema.Class<PackageJson>("PackageJson")({
4848
name: Schema.String,
4949
version: Schema.String,
5050
description: Schema.String,
51+
type: Schema.optionalWith(Schema.Literal("commonjs", "module"), {
52+
default: () => "commonjs"
53+
}),
5154
private: Schema.optionalWith(Schema.Boolean, { default: () => false }),
5255
publishConfig: Schema.optional(Schema.Struct({
5356
provenance: Schema.optionalWith(Schema.Boolean, { default: () => false }),

0 commit comments

Comments
 (0)