diff --git a/packages/core/package.json b/packages/core/package.json index b0377dfeb..70d136ade 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,6 +3,12 @@ "version": "3.0.0-alpha.4", "description": "Asciidoctor - the core library", "main": "dist/node/asciidoctor.js", + "exports": { + ".": { + "require": "./dist/node/asciidoctor.cjs", + "import": "./dist/node/asciidoctor.js" + } + }, "browser": "dist/browser/asciidoctor.js", "module": "dist/browser/asciidoctor.js", "type": "module", diff --git a/packages/core/tasks/module/builder.cjs b/packages/core/tasks/module/builder.cjs index 853fa7351..fc5b7a3f9 100644 --- a/packages/core/tasks/module/builder.cjs +++ b/packages/core/tasks/module/builder.cjs @@ -246,5 +246,6 @@ module.exports = class Builder { for (const environment of this.environments) { bfs.copySync(`build/asciidoctor-${environment}.js`, `dist/${environment}/asciidoctor.js`) } + bfs.copySync('build/asciidoctor-node.cjs', 'dist/node/asciidoctor.cjs') } }