refactor: move to vite bundler

This commit is contained in:
Derrick Hammer 2023-07-08 04:03:18 -04:00
parent af224e742a
commit cb3421b662
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
4 changed files with 973 additions and 1554 deletions

View File

@ -3,7 +3,12 @@
"@lumeweb/presetter-kernel-module-preset" "@lumeweb/presetter-kernel-module-preset"
], ],
"config": { "config": {
"official": true, "vite": {
"browser": true "resolve": {
"alias": {
"sodium-universal": "@screamingvoid/sodium-universal"
}
}
}
} }
} }

2446
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,14 +10,14 @@
}, },
"scripts": { "scripts": {
"prepare": "presetter bootstrap", "prepare": "presetter bootstrap",
"build": "shx touch nop.js; run build", "build": "run build",
"semantic-release": "semantic-release", "semantic-release": "semantic-release",
"postinstall": "patch-package" "postinstall": "patch-package"
}, },
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@lumeweb/hyperswarm-web": "0.0.2-develop.7", "@lumeweb/hyperswarm-web": "0.0.2-develop.7",
"@lumeweb/libkernel": "^0.1.0-develop.13", "@lumeweb/libkernel": "^0.1.0-develop.14",
"@lumeweb/rpc": "0.0.2-develop.1", "@lumeweb/rpc": "0.0.2-develop.1",
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@peculiar/webcrypto": "^1.4.3", "@peculiar/webcrypto": "^1.4.3",
@ -31,7 +31,7 @@
"protomux": "^3.5.0" "protomux": "^3.5.0"
}, },
"devDependencies": { "devDependencies": {
"@lumeweb/presetter-kernel-module-preset": "^0.1.0-develop.29", "@lumeweb/presetter-kernel-module-preset": "^0.1.0-develop.38",
"@rollup/plugin-alias": "^5.0.0", "@rollup/plugin-alias": "^5.0.0",
"@types/b4a": "^1.6.0", "@types/b4a": "^1.6.0",
"crypto-browserify": "^3.12.0", "crypto-browserify": "^3.12.0",

View File

@ -1,66 +0,0 @@
// @ts-nocheck
import * as import0 from "@rollup/plugin-json";
import * as import1 from "@rollup/plugin-node-resolve";
import * as import2 from "@rollup/plugin-commonjs";
import * as import3 from "@rollup/plugin-graphql";
import * as import4 from "@rollup/plugin-image";
import * as import5 from "@rollup/plugin-yaml";
import * as import6 from "rollup-plugin-postcss";
import * as import7 from "rollup-plugin-visualizer";
import * as import8 from "@rollup/plugin-wasm";
import * as import9 from "@rollup/plugin-alias";
const customResolver = import1.default({
extensions: [".js"],
browser: true,
});
export default {
input: "build/index.js",
output: [
{
file: "lib/index.js",
format: "cjs",
sourcemap: false,
inlineDynamicImports: true,
},
],
plugins: [
import0.default(...([] as const)),
import9.default({
entries: {
"crypto": "crypto-browserify",
"sodium-universal": "@screamingvoid/sodium-universal",
},
customResolver,
}),
import9.default({
entries: {
"node-fetch": "./nop.js",
"stream": "./nop.js",
"formdata-polyfill/formdata-to-blob.js": "./nop.js",
},
}),
import1.default(
...([
{
browser: true,
preferBuiltins: false,
dedupe: [
"@lumeweb/libkernel",
"@lumeweb/libweb",
"@lumeweb/libportal",
],
},
] as const),
),
import2.default(
...([{ extensions: [".js", ".jsx", ".ts", ".tsx"] }] as const),
),
import3.default(...([] as const)),
import4.default(...([] as const)),
import5.default(...([] as const)),
import6.default(...([{ inject: { insertAt: "top" } }] as const)),
import7.visualizer(...([] as const)),
import8.default(...([{ targetEnv: "auto-inline" }] as const)),
],
};