Skip to content

Settings of @changesets/read are incorrect and cause problems when using native esm #622

@JounQin

Description

@JounQin

Affected Packages

pkg:@changesets/read

Problem

@changesets/read is not set as type: "module" currently, so dist/read.cjs.js will be used in native esm, but dist/read.cjs.prod.js is still wrapped into exports.default statement.

Proposed solution

Change dist/read.cjs.js like following:

'use strict';

if (process.env.NODE_ENV === "production") {
  module.exports = require("./read.cjs.prod.js").default;
} else {
  module.exports = require("./read.cjs.dev.js").default;
}

That would be nicer to migrate to type: "module" at the same time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions