migrating cjs -> esm

This commit is contained in:
yigid balaban 2024-10-07 20:48:28 +03:00
parent b91c95bde3
commit 3609a154a9
Signed by: fyb
GPG Key ID: CF1BBD1336C0A3D6
8 changed files with 27 additions and 18 deletions

1
.npmignore Normal file
View File

@ -0,0 +1 @@
dist/

2
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

12
dist/index.html vendored Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ZKL Key Derivation Service Demo</title>
</head>
<body>
<script src="bundle.js"></script>
</body>
</html>

View File

@ -1,4 +1,4 @@
import { generateKeypair } from "./key-derivation.js";
import { generateKeypair } from "../key-derivation.js";
(async () => {
console.log("start");

View File

@ -1,9 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ZKL Key Derivation Service Demo</title>
</head>
<body>
<script src="dist/bundle.js"></script>
</body>
</html>

View File

@ -4,7 +4,7 @@ import {
} from "@scure/bip39";
import { wordlist } from "@scure/bip39/wordlists/english";
import elliptic from "elliptic";
import { Key } from "./key";
import { Key } from "./key.js";
const MNEMONIC_STRENGTH = 192;
//const CURVE = "curve25519"

View File

@ -1,8 +1,9 @@
{
"name": "@zklx/kds",
"version": "1.0.0",
"version": "1.0.1",
"description": "zk-Lokomotive key derivation service",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},

View File

@ -1,9 +1,13 @@
const path = require("path");
const webpack = require("webpack");
const TerserPlugin = require("terser-webpack-plugin");
import path from "path";
import { fileURLToPath } from "url";
import webpack from "webpack";
import TerserPlugin from "terser-webpack-plugin";
module.exports = {
entry: "./index.js",
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default {
entry: "./dist/index.js",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist")