Skip to content

Commit

Permalink
revert names
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Mar 18, 2021
1 parent 5f20236 commit 22ec6ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"type": "git",
"url": "git://github.com/highlightjs/highlight.js.git"
},
"main": "./lib/index.mjs",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"imports": {
"#hljs": "./build/lib/index.js",
Expand Down
8 changes: 4 additions & 4 deletions tools/build_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const { rollupWrite } = require("./lib/bundling.js");
const log = (...args) => console.log(...args);

async function buildNodeIndex(name, languages) {
const header = `import hljs from './core.mjs';`;
const header = `import hljs from './core.js';`;
const footer = "export default hljs;";

const registration = languages.map((lang) => {
let out = '';
const importName = "L_" + lang.name.replace("-","_")
let require = `import ${importName} from './languages/${lang.name}.mjs';`;
let require = `import ${importName} from './languages/${lang.name}.js';`;
// TODO: break this with v11? All modules must export default?
if (lang.loader) {
require = require += `.${lang.loader}`;
Expand All @@ -22,7 +22,7 @@ async function buildNodeIndex(name, languages) {
});

const index = `${header}\n\n${registration.join("\n")}\n\n${footer}`;
await fs.writeFile(`${process.env.BUILD_DIR}/lib/${name}.mjs`, index);
await fs.writeFile(`${process.env.BUILD_DIR}/lib/${name}.js`, index);
}

async function buildNodeLanguage(language) {
Expand All @@ -39,7 +39,7 @@ async function buildNodeHighlightJS() {

async function buildPackageJSON() {
const packageJson = require("../package");
packageJson.type = 'commonjs';
packageJson.type = 'module';
await fs.writeFile(`${process.env.BUILD_DIR}/package.json`, JSON.stringify(packageJson, null, 2));
}

Expand Down

0 comments on commit 22ec6ff

Please sign in to comment.