Rely on snowpack to serve node modules

This commit is contained in:
Danila Fedorin 2021-08-04 16:31:05 -07:00
parent c5153339c0
commit d5503b2e6b
8 changed files with 10 additions and 10 deletions

View File

@ -343,7 +343,7 @@ export function parseHTMLBody(platform, mediaRepository, html) {
return new MessageBody(html, parts);
}
import parse from '../../../../../lib/node-html-parser/index.js';
import parse from 'node-html-parser';
export function tests() {
class HTMLParseResult {

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import anotherjson from "../../../lib/another-json/index.js";
import anotherjson from "another-json";
import {SESSION_KEY_PREFIX, OLM_ALGORITHM, MEGOLM_ALGORITHM} from "./common.js";
// use common prefix so it's easy to clear properties that are not e2ee related during session clear

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import anotherjson from "../../../lib/another-json/index.js";
import anotherjson from "another-json";
import {createEnum} from "../../utils/enum.js";
export const DecryptionSource = createEnum("Sync", "Timeline", "Retry");

View File

@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {FDBFactory, FDBKeyRange} from "../../lib/fake-indexeddb/index.js";
import fdb from "fake-indexeddb";
import {StorageFactory} from "../matrix/storage/idb/StorageFactory.js";
export function createMockStorage() {
return new StorageFactory(null, new FDBFactory(), FDBKeyRange).create(1);
return new StorageFactory(null, new fdb.FDBFactory(), fdb.FDBKeyRange).create(1);
}

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import aesjs from "../../../lib/aes-js/index.js";
import aesjs from "aes-js";
import {hkdf} from "../../utils/crypto/hkdf.js";
import {Platform as ModernPlatform} from "./Platform.js";

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import base64 from "../../../../lib/base64-arraybuffer/index.js";
import base64 from "base64-arraybuffer";
// turn IE11 result into promise
function subtleCryptoResult(promiseOrOp, method) {

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import DOMPurify from "../../../lib/dompurify/index.js"
import DOMPurify from "dompurify"
class HTMLParseResult {
constructor(bodyNode) {

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import base64 from "../../../../lib/base64-arraybuffer/index.js";
import base64 from "base64-arraybuffer";
export class Base64 {
encodeUnpadded(buffer) {