npm package, cjs -> esm...

This commit is contained in:
2024-10-07 21:30:18 +03:00
parent 28ce8c6fb3
commit 9ea2dd5f69
15 changed files with 410 additions and 292 deletions

View File

@@ -1,13 +1,17 @@
const path = require("path");
import path from "path";
import { fileURLToPath } from "url";
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",
filename: "./bundle.js",
path: path.resolve(__dirname, "dist"),
},
experiments: {
syncWebAssembly: true,
},
mode: "development",
mode: "production",
};