Skip to content

Get rid of CommonJS module format, use only ES Modules. #2102

Closed
@trusktr

Description

@trusktr

Feature request

The future is already here, and it is ES Modules. We currently build SSR to CommonJS, for example. CommonJS is outdated now, and we should move onto ES Modules and simplify our setup for all possible tooling that now understand the ES Module standard.

What problem does this feature solve?

We have legacy complexity. Move to modern standard.

What does the proposed API look like?

Remove any CommonJS (CJS) outputs, ensure everything is ES Modules (ESM).

Note, .eslintrc.cjs remains as CommonJS because current ESLint v8 doesn't support ESM in eslintrc. ESLint 9 will require the new "flat config" format, which will require ESM.

How should this be implemented in your opinion?

F.e. open rollup configs, don't output to cjs, output to esm.

Are you willing to work on this yourself?

Yes (PR #2106)

Is this a breaking change?

Yes, this update can possibly break any dev's tooling relying on old CJS. This will not break people who import Docsify with script tag, only people who build Docsify source code. We should provide a clear path in the release notes.

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