mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Bundle sql worker with webpack
This commit is contained in:
committed by
Scott Nonnenberg
parent
31a777a130
commit
1ca121aef5
13
ts/sql/mainWorkerBindings.ts
Normal file
13
ts/sql/mainWorkerBindings.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
// This is a shim that gets inserted in place of `bindings` npm module when
|
||||
// building sql worker bundle.
|
||||
module.exports = (binding: string) => {
|
||||
if (binding === 'better_sqlite3.node') {
|
||||
// eslint-disable-next-line global-require, import/no-unresolved
|
||||
return require('better_sqlite3.node');
|
||||
}
|
||||
|
||||
throw new Error(`Unknown binding ${binding}`);
|
||||
};
|
||||
Reference in New Issue
Block a user