From ad2384e4de274b18304e5f18c7d63ee43c2feec4 Mon Sep 17 00:00:00 2001 From: Cris Stringfellow <22254235+crislin2046@users.noreply.github.com> Date: Wed, 11 Jan 2023 11:41:26 +0800 Subject: [PATCH] Build works --- package.json | 20 +++++--------------- src/common.js | 6 +++--- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 17c58b0..ec153cb 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "diskernet", - "version": "2.6.0", + "version": "2.4.11", + "type": "module", "description": "Library server and an archivist browser controller.", - "main": "build/22120.js", - "module": "src/app.js", + "main": "src/app.js", + "module": "dist/22120-module.js", "bin": { "diskernet": "build/22120.js" }, @@ -26,21 +27,11 @@ "url": "git+https://github.com/dosyago/22120.git" }, "pkg": { - "patches": { - "./node_modules/fetch-blob/streams.cjs": [ - "Object.assign(globalThis, require('node:stream/web'))", - "Object.assign(globalThis, require('stream').web)" - ] - }, "scripts": "build/*.js", "assets": "public/**/*", "outputPath": "bin" }, "keywords": [ - "web-archive", - "search-engine", - "self-hosted", - "offline", "archivist", "library" ], @@ -71,7 +62,6 @@ "nodemon": "latest", "npx": "^3.0.0", "webpack": "latest", - "webpack-cli": "latest", - "rollup-plugin-terser": "^7.0.2" + "webpack-cli": "latest" } } diff --git a/src/common.js b/src/common.js index 8afa646..ce7e0e8 100644 --- a/src/common.js +++ b/src/common.js @@ -1,5 +1,5 @@ import path from 'path'; -//import {fileURLToPath} from 'url'; +import {fileURLToPath} from 'url'; export const DEBUG = process.env.DEBUG_22120 || false; export const SHOW_FETCH = false; @@ -40,8 +40,8 @@ export const SNIP_CONTEXT = 31; export const NO_SANDBOX = process.env.DEBUG_22120 || false; //export const APP_ROOT = '.'; -export const APP_ROOT = __dirname; -//export const APP_ROOT = path.dirname(fileURLToPath(import.meta.url)); +//export const APP_ROOT = __dirname; +export const APP_ROOT = path.dirname(fileURLToPath(import.meta.url)); export const sleep = ms => new Promise(res => setTimeout(res, ms));