diff --git a/.travis.yml b/.travis.yml index fa61a6a0e9..67fd1364cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,5 +29,7 @@ script: npm run test else npm run test-browser + # our browser build should also work fine as a Node.js CommonJS module + node test/builds/browser_build_as_commonjs.js fi sudo: false # Use container-based architecture diff --git a/CHANGES.md b/CHANGES.md index a36b69e06f..0bb8118b1d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,19 @@ +## Version 10.0.2 (pending) + +Brower build: + +- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (bug) Fix: Version 10 fails to load as CommonJS module. (#2511) [Josh Goebel][] +- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (removal) AMD module loading support has been removed. (#2511) [Josh Goebel][] + + +Parser Engine Changes: + +- ... + + +[Josh Goebel]: https://github.com/yyyc514 + + ## Version 10.0.1 Parser Engine Changes: diff --git a/test/builds/browser_build_as_commonjs.js b/test/builds/browser_build_as_commonjs.js new file mode 100644 index 0000000000..4315df2ff0 --- /dev/null +++ b/test/builds/browser_build_as_commonjs.js @@ -0,0 +1,6 @@ +const hljs = require("../../build/highlight"); + +let major = parseInt(majorVersion=hljs.versionString.split(".")) +if (major != 10) { + process.exit(1) +} diff --git a/tools/build_config.js b/tools/build_config.js index 6ce035be96..c32efe993c 100644 --- a/tools/build_config.js +++ b/tools/build_config.js @@ -29,7 +29,8 @@ module.exports = { }, output: { name: "hljs", - format: "umd", + format: "iife", + footer: "if (typeof exports === 'object' && typeof module !== 'undefined') { module.exports = hljs; }", interop: false, } },