Skip to content

Commit

Permalink
export exports.default as well for TS
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Oct 6, 2021
1 parent f959f18 commit e98b983
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/build_config.js
Expand Up @@ -32,7 +32,7 @@ module.exports = {
format: "cjs",
strict: false,
exports: "auto",
footer: "highlight.hljs = highlight;"
footer: "highlight.hljs = highlight;\nhighlight.default = highlight;"
}
},
browser_iife: {
Expand Down
4 changes: 3 additions & 1 deletion tools/build_node.js
Expand Up @@ -20,7 +20,9 @@ async function buildESMStub(name) {

async function buildCJSIndex(name, languages) {
const header = "var hljs = require('./core');";
const footer = `hljs.hljs = hljs\n` +
const footer =
`hljs.hljs = hljs\n` +
`hljs.default = hljs\n` +
`module.exports = hljs;`;

const registration = languages.map((lang) => {
Expand Down

0 comments on commit e98b983

Please sign in to comment.