mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
move shim to new package
This commit is contained in:
20
build.js
20
build.js
@@ -1,25 +1,9 @@
|
||||
const esbuild = require("esbuild");
|
||||
const path = require("path");
|
||||
|
||||
const { version: ignisVersion } = require("./package.json");
|
||||
|
||||
Promise.all([
|
||||
// Build shim-loader.js
|
||||
esbuild.build({
|
||||
entryPoints: [path.join(__dirname, "src", "shims", "loader.js")],
|
||||
bundle: true,
|
||||
outfile: path.join(__dirname, "dist", "shim-loader.js"),
|
||||
format: "iife",
|
||||
platform: "browser",
|
||||
target: ["chrome90"],
|
||||
alias: {
|
||||
path: "path-browserify",
|
||||
},
|
||||
define: {
|
||||
__IGNIS_VERSION__: JSON.stringify(ignisVersion),
|
||||
},
|
||||
logLevel: "info",
|
||||
}),
|
||||
// Build shim-loader.js (delegated to packages/shim)
|
||||
require("./packages/shim/build.js"),
|
||||
|
||||
// Build ignis-ui.js (delegated to packages/ui)
|
||||
require("./packages/ui/build.js"),
|
||||
|
||||
13
package-lock.json
generated
13
package-lock.json
generated
@@ -574,7 +574,6 @@
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.2.0.tgz",
|
||||
"integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 20.19.0"
|
||||
@@ -2739,7 +2738,6 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
|
||||
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/path-key": {
|
||||
@@ -4444,7 +4442,16 @@
|
||||
},
|
||||
"packages/shim": {
|
||||
"name": "@ignis/shim",
|
||||
"version": "0.0.0-internal"
|
||||
"version": "0.0.0-internal",
|
||||
"dependencies": {
|
||||
"@ignis/services": "*",
|
||||
"@noble/hashes": "^2.2.0",
|
||||
"pako": "^2.1.0",
|
||||
"path-browserify": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.20.0"
|
||||
}
|
||||
},
|
||||
"packages/ui": {
|
||||
"name": "@ignis/ui",
|
||||
|
||||
20
packages/shim/build.js
Normal file
20
packages/shim/build.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const esbuild = require("esbuild");
|
||||
const path = require("path");
|
||||
|
||||
const { version: ignisVersion } = require("../../package.json");
|
||||
|
||||
module.exports = esbuild.build({
|
||||
entryPoints: [path.join(__dirname, "src", "loader.js")],
|
||||
bundle: true,
|
||||
outfile: path.join(__dirname, "dist", "shim-loader.js"),
|
||||
format: "iife",
|
||||
platform: "browser",
|
||||
target: ["chrome90"],
|
||||
alias: {
|
||||
path: "path-browserify",
|
||||
},
|
||||
define: {
|
||||
__IGNIS_VERSION__: JSON.stringify(ignisVersion),
|
||||
},
|
||||
logLevel: "info",
|
||||
});
|
||||
@@ -2,5 +2,17 @@
|
||||
"name": "@ignis/shim",
|
||||
"version": "0.0.0-internal",
|
||||
"private": true,
|
||||
"main": "src/loader.js"
|
||||
"main": "src/loader.js",
|
||||
"scripts": {
|
||||
"build": "node build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ignis/services": "*",
|
||||
"@noble/hashes": "^2.2.0",
|
||||
"pako": "^2.1.0",
|
||||
"path-browserify": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.20.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ app.use((req, res, next) => {
|
||||
});
|
||||
|
||||
app.use(express.static(path.join(__dirname, "..", "packages", "ui", "dist")));
|
||||
app.use(express.static(path.join(__dirname, "..", "dist")));
|
||||
app.use(express.static(path.join(__dirname, "..", "packages", "shim", "dist")));
|
||||
|
||||
app.use(express.static(config.obsidianAssetsPath));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user