Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pico-api-docs",
"version": "1.6.0",
"version": "1.6.1",
"description": "PICO SulTeng API Documentation - COVID-19 Sulawesi Tengah Data API",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/lib/prism-global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Prism from 'prismjs'

// The language grammars in prismjs/components call a global `Prism`. Publish it in its own
// module so it exists before any grammar loads. The bundler does not guarantee that order
// for a side-effect import, and the production build failed with "Prism is not defined".
;(globalThis as { Prism?: typeof Prism }).Prism = Prism

export default Prism
4 changes: 2 additions & 2 deletions src/lib/prism-setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Prism from 'prismjs'
import Prism from './prism-global'

// Grammars register on the Prism singleton, so they must live in this one file
// (and one chunk) with the core. Only the languages the docs show are loaded.
// (and one chunk) with the core. prism-global publishes window.Prism first. Only the languages the docs show are loaded.
import 'prismjs/components/prism-bash'
import 'prismjs/components/prism-json'
import 'prismjs/components/prism-python'
Expand Down
Loading