-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build!: separate verovio for prod and dev
- Use `wasm` verovio for development (`webpack.config.js`) - Load from verovio website for production (`webpack.pages-config.js`) - Remove redundant `webpack.dev.config.js` Resolves: #1219, #1221
- Loading branch information
1 parent
ba92337
commit d418622
Showing
3 changed files
with
30 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
import { VerovioMessage } from './Types'; | ||
|
||
|
||
/** | ||
* A wrapper around the verovio web worker to permit mocking in tests. | ||
*/ | ||
export default class VerovioWrapper { | ||
verovioWorker: Worker; | ||
constructor () { | ||
this.verovioWorker = new Worker(__ASSET_PREFIX__ + 'workers/VerovioWorker-dev.js'); | ||
constructor() { | ||
if (process.env.NODE_ENV === 'production') { | ||
this.verovioWorker = new Worker( | ||
__ASSET_PREFIX__ + 'workers/VerovioWorker.js' | ||
); | ||
} else { | ||
this.verovioWorker = new Worker( | ||
__ASSET_PREFIX__ + 'workers/VerovioWorker-dev.js' | ||
); | ||
} | ||
} | ||
|
||
/** | ||
* Set an event listener onto the actual web worker. | ||
*/ | ||
addEventListener (type: string, handler: EventListenerOrEventListenerObject): void { | ||
addEventListener( | ||
type: string, | ||
handler: EventListenerOrEventListenerObject | ||
): void { | ||
return this.verovioWorker.addEventListener(type, handler); | ||
} | ||
|
||
/** | ||
* Send a message to the actual web worker. | ||
*/ | ||
postMessage (message: VerovioMessage): void { | ||
postMessage(message: VerovioMessage): void { | ||
return this.verovioWorker.postMessage(message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.