Corrected ES6 exports

This commit is contained in:
Ben Ashton 2021-03-14 21:46:25 -07:00
parent 1c799ba110
commit 7a6d1c4c5a
6 changed files with 15 additions and 10 deletions

View File

@ -87,7 +87,7 @@ function log(...args) {
function enableDebug(active) { function enableDebug(active) {
DEBUG = !!active; DEBUG = !!active;
log("PawSQLite-WebSQL-Adapter: debugging " + ( log("PawSQLite-Node-Adapter: debugging " + (
DEBUG ? "enabled" : "disabled") DEBUG ? "enabled" : "disabled")
); );
} }
@ -292,7 +292,7 @@ var __webpack_exports__ = {};
\******************************/ \******************************/
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ "PawSQLiteNodeAdapter": () => (/* binding */ PawSQLiteNodeAdapter)
/* harmony export */ }); /* harmony export */ });
/* harmony import */ var _node_adapter_error_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_adapter_error.mjs */ "./src/node_adapter_error.mjs"); /* harmony import */ var _node_adapter_error_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_adapter_error.mjs */ "./src/node_adapter_error.mjs");
/* harmony import */ var _database_wrapper_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./database_wrapper.mjs */ "./src/database_wrapper.mjs"); /* harmony import */ var _database_wrapper_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./database_wrapper.mjs */ "./src/database_wrapper.mjs");
@ -305,7 +305,7 @@ __webpack_require__.r(__webpack_exports__);
const databases = new Map(); const databases = new Map();
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ const PawSQLiteNodeAdapter = {
name: "PawSQLiteNodeAdapter", name: "PawSQLiteNodeAdapter",
open: async (dbName) => { open: async (dbName) => {
if (!databases.has(dbName)) { if (!databases.has(dbName)) {
@ -337,7 +337,7 @@ const databases = new Map();
}, },
debug: _log_mjs__WEBPACK_IMPORTED_MODULE_3__.enableDebug debug: _log_mjs__WEBPACK_IMPORTED_MODULE_3__.enableDebug
}); };
function getDatabase(dbName) { function getDatabase(dbName) {
@ -349,7 +349,7 @@ function getDatabase(dbName) {
} }
})(); })();
module.exports = __webpack_exports__.default; module.exports = __webpack_exports__.PawSQLiteNodeAdapter;
/******/ })() /******/ })()
; ;
//# sourceMappingURL=pawsqlite-node-adapter.js.map //# sourceMappingURL=pawsqlite-node-adapter.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,12 @@
"name": "pawsqlite-node-adapter", "name": "pawsqlite-node-adapter",
"version": "1.0.0", "version": "1.0.0",
"description": "A Node.js adapter for PawSQLite", "description": "A Node.js adapter for PawSQLite",
"main": "./lib/pawsqlite-node-adapter.js", "main": "./cjs/pawsqlite-node-adapter.js",
"exports": {
"import": "./src/node_adapter.mjs",
"require": "./cjs/pawsqlite-node-adapter.js"
},
"module": "./src/node_adapter.mjs",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack" "build": "webpack"

View File

@ -5,7 +5,7 @@ import { enableDebug, log } from "./log.mjs";
const databases = new Map(); const databases = new Map();
export default { export const PawSQLiteNodeAdapter = {
name: "PawSQLiteNodeAdapter", name: "PawSQLiteNodeAdapter",
open: async (dbName) => { open: async (dbName) => {
if (!databases.has(dbName)) { if (!databases.has(dbName)) {

View File

@ -10,9 +10,9 @@ var config = {
sqlite3: 'sqlite3' sqlite3: 'sqlite3'
}, },
output: { output: {
path: __dirname + '/lib', path: __dirname + '/cjs',
filename: outputFile, filename: outputFile,
libraryExport: 'default', libraryExport: 'PawSQLiteNodeAdapter',
libraryTarget: 'commonjs2', libraryTarget: 'commonjs2',
} }
}; };