Convert backend code to ES modules

Bundling code now with Rollup for its flat bundling and tree shaking
support. Front end code still goes through Webpack for browser support.
This commit is contained in:
Zaid Abdulla committed 2019-02-04 23:47:54 -08:00
1 parent 824639976f
commit 1e41c72d60
62 files changed
+718 -898

No files matched your search

+5 -5
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env node
#!/usr/bin/env -S node -r esm
"use strict";
const mongodb = require("mongodb");
const config = require("../lib/config");
import { MongoClient } from "mongodb";
import { get } from "../lib/config";
const configData = {
"auth.simple.users.admin.password": "'admin'",
@@ -158,8 +158,8 @@ const configData = {
};
async function run() {
const client = await mongodb.MongoClient.connect(
config.get("MONGODB_CONNECTION_URL"),
const client = await MongoClient.connect(
get("MONGODB_CONNECTION_URL"),
{ useNewUrlParser: true }
);
const collection = client.db().collection("config");