Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(build) browser build is CommonJS and IIFE (global) #2511

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -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
16 changes: 16 additions & 0 deletions CHANGES.md
Expand Up @@ -30,6 +30,22 @@ Language Improvements:
[Vania Kucher]: https://github.com/qWici


## 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:
Expand Down
6 changes: 6 additions & 0 deletions 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)
}
3 changes: 2 additions & 1 deletion tools/build_config.js
Expand Up @@ -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,
}
},
Expand Down